- Home /
Detecting Future Movement of Object
Alright, currently I have a first person game with a script that picks up rigidbody objects when the player mouses over them and holds the left mouse button down. Everything is working beautifully, The object follows the player and can even be thrown. However, the object is set to hover in front of the player at a set distance. This means that if I were to walk, while holding the object, directly into a wall the object warps to the other side. This can be fixed by enlarging the thickness of the wall but I want to refrain from doing this for performance issues. Is there any way I can detect if the object is warping before it does so? If I could calculate and check where its going before the position is applied that might work I just don't know how to do so. Also, is there some way to detect when an object "glitches" due to being inside another? Thanks to anyone who answers :D
You are probably using translate function and that's why. Try
http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.$$anonymous$$ovePosition.html
With this you should be fine.
I am using $$anonymous$$ovePosition and it doesn't fix the issue. The object won't stick into the wall but will warp around it when I get close enough.
Your answer
Follow this Question
Related Questions
Object moving but not only on the axis i want 1 Answer
why my object is moving first and then it falls down? 2 Answers
raycast isn't working in my movetowards script. 1 Answer
gameobject warping 3 Answers