Sporadic rotating with negative angles

BurzmaliBurzmali Member Posts: 9
edited November -1 in Tech Support
Using the Rotate to Angle behavior to rotate to a negative angle actually causes the actor to rotate non-stop. That's in most cases, anyways. This came up as I was using the "vectorToAngle" expression to make an actor rotate to the touch location. There's an easy fix of just adding 360 to the result, but it took me about 30 minutes to figure out the problem and fix it.

Comments

  • rebumprebump Member Posts: 1,058
    Actually, that is a new "feature" to 0.8.x. If entering a negative angle degree value in 0.7.0, it would convert it to the positive angle equivalent. Also, I think it 'moduloused' the value by 360 to ensure the value was always between 0 and 359.

    And by feature I may mean bug unless that is what they intend.
  • rebumprebump Member Posts: 1,058
    It looks like it still converts the negative to a positive angle but sporadically behaves differently (i.e. sometimes it doesn't stop like you say).

    Also, if an actor was at 0/360, if I put in 0 (or 360 that gets converted to 0), in 0.7.0 it would give me one full controlled rotation. Now a 0 yields no rotation.

    I'd like to see some easy way to get a single controlled rotation now...
  • ORBZORBZ Member Posts: 1,304
    toggle between 360 and 0?

    when 0 enter 360 when 360 enter 0 .. wouldn't that work?

    also, if you use an angle data type i think it does the modulus for you, but i could be wrong.
  • rebumprebump Member Posts: 1,058
    It does do the modulus for you, so if you put in 360, you get 0. If you put in 359 to fake it (from 0) you get -1 degree of rotation instead of 359 degrees of rotation. Much different than in 0.7.0.

    It was programmed to take the least "resistive" (if you will) path.

    You could put in two "Rotate to Angle" one to take you from 0 to 180 and the next to take you back to 0 from 180 but then if you have them at the same execution level, no guarantee what order they run in so you have to delay one a fraction of a second and you get a hiccup in the rotation.

    Seems like another boolean option on the "Rotate to Angle" for whether or not to perform modulus on the angle entered would be neat (thus if you turned off the feature, you could put in 720 degrees to get two exact rotations). They could call the boolean "Normalize Angle?" or something.
  • ckurt25ckurt25 Member Posts: 122
    Had to comment.... I love being able to search the forums and find answers. Buzermali, you are the man. Thanks for sharing.
  • hillelchillelc Member Posts: 56
    Hi:

    Did anything ever come of this? I would like to rotate an object 360 degrees in place as a response to someone touching it.

    it seems like being able to specify direction (and not leave it to the current 'shortest path' logic) and to specify rotation that goes beyond 360 degrees (multiple rotations) would be key to making this work.

    Any thoughts chefs? :)
Sign In or Register to comment.