how to stop an object attached to a Roll-a-Ball ,from rotating with it?
So I'm trying to make a roll-a-ball game , I attached like a turret gun on the sides of the sphere but Idk how to stop it from rotating with the sphere.... any idea how to stop this -Thanks!
If you want to keep the rigidbody properties of your ball, you could just write a script for the turret to update its position stay above the ball (relative to the ball). Something like:
transform.position = ball.transform.position + Vector.up * 0.5;
Answer by snorcack · Nov 10, 2016 at 11:23 AM
Create a Parent Game Object that has the ball and the turrets as a child. Translate this gameobject to move the balls position while rotating the ball inside to give a rolling effect. This will keep the turrets moving with the ball without rotating.
Or you can create a script that copies the position of the ball transform and adjusts the turrets accordingly every frame. In this scenario, both the turrets and the ball will be separate gameobjects. Let me know if you need more clarification. Cheers !
Your answer
Follow this Question
Related Questions
Ball doesn't roll in roll-a-ball for mac 0 Answers
Random Number every 5 seconds 2 Answers
Help with Randomized Sprite on GUI button click 0 Answers
Randomly generate blocks on a flat map 0 Answers