In my game I’m trying to make the front two tire’s of a car move left and right, like in a normal car when you turn. The actual movement of the car is perfect and ready to go, and I even got the tire’s to move left and right, but I can’t restrict their rotation with Mathf.Clamp. It’s probably because they’re child’s of the car. I get them to rotate by rotating them around the global y axis, could that also be a problem? Anything will help thanks a bunch!
Have a look at the car tutorial in the asset store.
I would use a game object for the steering around the y axis. The wheel itself needs to be a child that steering game object. That wheel can roll, meaning rotate around x or z axis. Like that clamping should be no problem at all. Just control the y rotation of the steering game object.
→ Steer (Clamp that one for the steering)
→ Roll (Place the wheel mesh in here or in a child)