- Home /
Charcter to hold an object that collides and can let go.
Currently the system I have setup is to move the held object towards a position in front of the player. This object is always going to be a ridigbody and I alter it's velocity directly (with lerp) over using force (because I don't know how to calculate force needed to reach a certain point).
The object being held can have some allowance for how fast it moves and it must collide with walls and the like, so that if the player tries to move it through a wall, the object will be let go (gravity is turned back on at this point).
Other requirements: The object's rigidbody cannot be switched to kinematic.
I've been looking at joints, if this is a good method, can anyone recomend which one to use? I believe spring joint is the one I want.
Thanks!
Edit: I should probably mention that with my current setup, the reason I can't use it is because since i'm changing the velocity directly, it means that with enough force, the object can move through thin walls with general ease.
Answer by Rabwin · May 13, 2013 at 03:14 PM
I ended up using a rigidbody that sits inside the character's gameObject which acts as the handle. I create a spring joint between the object and the handle, and do some if statements checking for LOS and distance to purposely break the joint. Spring joints are quite orgasmic.
Your answer
Follow this Question
Related Questions
Moving a Rigidbody and then connecting a joint? 1 Answer
Physics: Grab Object and Swing Freely Relative to Mouse Cursor 0 Answers
Rigidbody hinged to moving kinematic rigidbody is NOT constrained 0 Answers
Rigidbody Sliding UP Incline 0 Answers
Violent shaking when using position drive in Configurable Joints 1 Answer