Rotation constraint question - constrain to min and max

JamesZeppelinJamesZeppelin Member Posts: 1,927
edited November -1 in Working with GS (Mac)
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

Comments

  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    Just bumping before it disappears...

    im stuck
  • synthesissynthesis Member Posts: 1,693
    Try swapping back and forth between rotation with acceleration (when the actor is "impacted" by a touch for example) and then rotate to angle after X seconds...like an automatic tuner dial with a snapping ability.

    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.
  • synthesissynthesis Member Posts: 1,693
    The gravity thing could be modified by having the pointer actor always trying to moveTo or accelerate towards a set XY point if it is impacted by another event.
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    Yeah that sounds good in theory, and i like the way it could work

    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
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    Ok, problem solved

    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
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    nice way to fix it....good to know...cheers for posting your findings TinyMonster
  • alcamiealcamie Member Posts: 53
    I'm bumping this because I have a similar yet different constraint issue..
    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
  • alcamiealcamie Member Posts: 53
    alcamie said:
    I'm bumping this because I have a similar yet different constraint issue..
    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 see the answer.

    Cheers

Sign In or Register to comment.