Arrow physics revisited
Posted: Fri Mar 07, 2014 2:08 am
Hey Norbo. I asked a question a while ago about making an arrow that sticks into the ground and got it working pretty well at the time. I'm now revisiting it though and want to get some additional features working. Previously I was removing the arrow's physics entity upon collision so it would stay stuck in the ground.
I want to change it so that the player can pick up the arrow after it hits the ground and also have the arrow fall and behave properly if the ground below it is removed (the terrain is modifiable). I tried leaving the arrow's physics entity alone after collision, but of course the arrow doesn't stick in place anymore. I thought maybe I could weld it to the ground, but WeldJoint only accepts 2 entities. I think I remember that setting one to null will weld it to the world, but then the arrow will just be stuck floating in air if the terrain below it disappears. I also thought to maybe just disable gravity for the arrow but then it wouldn't fall when the terrain is modified.
Basically I just want the arrow to stay still until the terrain it's attached to is removed or it collides with the player item detector shape. Any ideas?
I want to change it so that the player can pick up the arrow after it hits the ground and also have the arrow fall and behave properly if the ground below it is removed (the terrain is modifiable). I tried leaving the arrow's physics entity alone after collision, but of course the arrow doesn't stick in place anymore. I thought maybe I could weld it to the ground, but WeldJoint only accepts 2 entities. I think I remember that setting one to null will weld it to the world, but then the arrow will just be stuck floating in air if the terrain below it disappears. I also thought to maybe just disable gravity for the arrow but then it wouldn't fall when the terrain is modified.
Basically I just want the arrow to stay still until the terrain it's attached to is removed or it collides with the player item detector shape. Any ideas?