Using min and max in one constraint?
Hi GS community, if someone could help me out with some math...
I have an actor whose rotation I need to constrain between -60 and 60.
Right now, I'm using two constraints: one constrains actor.Rotation to min(actor.Rotation, 60).
And the second: actor.Rotation to max(actor.Rotation, -60), which works.
But I think that there is a way to use only one constraint (which would help a lot for the many aspects of my game). I'm pretty sure I saw someone use it in a video, but I can't be certain. Is it possible?
Thanks in advance!
I have an actor whose rotation I need to constrain between -60 and 60.
Right now, I'm using two constraints: one constrains actor.Rotation to min(actor.Rotation, 60).
And the second: actor.Rotation to max(actor.Rotation, -60), which works.
But I think that there is a way to use only one constraint (which would help a lot for the many aspects of my game). I'm pretty sure I saw someone use it in a video, but I can't be certain. Is it possible?
Thanks in advance!
Best Answer
-
RThurman Posts: 2,881
it would look something like this:
Constrain: self.Rotation To: min(60,max(-60,Rotation)