Disclaimer: everywhere I say “spin” I mean rotation on the object’s own axis.
I’ve got a sun object that spins through a script using transform.Rotate (on its z axis), the planet children then orbit the sun using that rotation (through basic Unity parenting, no code involved). I’m also setting a spin speed for the planets through script. I’m trying to make it so that the rotation of the sun doesn’t affect the rotation of the planets, but so I can still modify their rotation through code.
Currently trying to do this with the Rotation Constraint component. But the only thing I can get out of it, is either the planets don’t rotate at all, or they don’t rotate through the code and only through the parent.
This is my current setup:
Freezing z rotation axes freezes all rotation as long as the source’s weight(?) is above 0. Unfreezing it just makes the planet spin relative to the sun (also as long as source’s weight is above 0).
Is it at all possible to achieve what I want, using this component? (making planet rotation be only affected through code while it’s parented to the sun)?