- Home /
Unity 2D C# - Make Parent Object not move Children Object?
So i have an ability in my game that gives you a grappling hook. Everything is done but i have one problem with the parent. I made a script about that object to follow the player and everything is working fine except in high speeds-- the gun gets delayed. I tried to just parent the gun to the object but when i move to the opposite side, the gun also flips. My grappling hook is controlled by the mouse cursor and it is following it but it snaps to the other side when i move my character. Is there a way to keep the grappling hook on a specific location parented in the player and stop it from flipping? I am thinking of just putting the Follow Script back and just put a speed cap to the player if i can't solve the problem lol
Answer by asafsitner · Mar 15 at 05:38 PM
Take a look at Unity Constraint Components, and specifically the Position constraint, which allows you to "attach" an object to another without relying on a parent-child relationship.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Unity2d shooting bullets is off when the gun is rotated to the left 0 Answers
KEEP INSTANTIATE PREFAB ONMOUSEDOWN 1 Answer