Rotation constraint question - constrain to min and max
JamesZeppelin
Member Posts: 1,927
Before i ask i must say that i have been looking in the forums for about an hour now.
There a lot of angle constraint post so, maybe i'm missing something
All i need to do is make an object that gets kicked around a lot (a rectangle)
not rotate counter clockwise past 80 or clockwise past 260
basically just tip back and fourth a little rather than spin all the way around if it gets hit real hard
thanks
There a lot of angle constraint post so, maybe i'm missing something
All i need to do is make an object that gets kicked around a lot (a rectangle)
not rotate counter clockwise past 80 or clockwise past 260
basically just tip back and fourth a little rather than spin all the way around if it gets hit real hard
thanks
Comments
im stuck
You could also do this even slicker if you have gravity in play. Constrain a transparent pointer actor to an edge point of the rotating actor. Then give that pointer impact physics. Then tie the rotation dial to the pointer by a rotation to point behavior. The pointer will always want to point down but will fly around when touched or bumped but then always try to return to down...like a tire swing. The dial will follow the pointer then.
If you are looking to just control a dial range...< = > Rules should control that.
but, i would just settle the part of the constrain attribute i am missing
basically just constrain it with "constrain attribute"
self.rotation = "the min,max part i am missing here"
thanks
I completely overlooked the easiest solution
Just add "rotate to angle" set to 0 and then just played with the speed worked for me.
this way it is always auto correcting itself
der
I am rotating a gun based on the angle vector. i.e.
contraint attribute: self.rotate = vectorToAngle( game.fireHitX - self.Position.X , game.fireHitY - self.Position.Y )
this ia a feed back loop created by adding:
Constraint Attribut: setGunX
game.gunX = self.Position.X
Constraint Attribut: setGunY
game.gunY = self.Position.Y
This way I get a very cheap (in CPU usage terms) gun rotate to where mouse tap or finger tap happens.
I now want to constrain the rotation going past vertical up or vertical down. (I want The gun always pointing to the left in otherwords between up and down zenith).
any help would be great cos for some reason I just can't se the answer.
Cheers