- Home /
rolling 2d ball, but keeping the texture from rotating
Hello. Was wondering what's the best way to constrain the texture of a 2d ball from rotating while the collision rolls and bounces it around using physics? I was thinking that I would just parent the position of the ball to another gameobject that has the collision on it.. That makes sense, but I was wondering if it's the best way to do it? creating two gameobjects in a scene just for the ball? Thanks
Do it! As I know there is no other simple way to do it, and depending on how many of these balls you wish to spawn, it will have almost no impact on performance.
I think you just need to Use the Lerp function and don't require rotation if you don't want to constrain the texture. In any case you won't get the visual of a rotating ball for the kind of effect you desire. Simply do a gradual position transform per frame without rotation.
Red
Thanks for comments. Yeah, I guess it's my way or the highway. I can't manually animate the ball, like I said it's a physics based ball.
Answer by N1warhead · Oct 09, 2014 at 07:30 AM
I've never done 2d, but if 2d can have a Rigidbody, see if you can freeze rotational constraints.
...then that would constrain the physics rotation of the ball.