What's wrong with this code?

My code is not working, and I have isolated the problem. It seems that this rule is not working: [if (self.rotation) > 0] I wondering if the attribute self.rotation is relative to the actor instead of the scene, but there is no apparent way to change this, and im not even sure this is the problem. Please help!

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    you'll have to give more details of what you're trying to do, and what exactly isn't working Maybe a screenshot of the actual rules and a description of what is happening vs what you expect to happen?
  • limes336limes336 Member Posts: 10
    you'll have to give more details of what you're trying to do, and what exactly isn't working Maybe a screenshot of the actual rules and a description of what is happening vs what you expect to happen?
    Image and video hosting by TinyPic
  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2014
    . . . this rule is not working: [if (self.rotation) > 0] I wondering if the attribute self.rotation is relative to the actor instead of the scene . . .
    self.rotaton is relative to the scene.
    . . but there is no apparent way to change this, and im not even sure this is the problem. Please help!
    I can only make a guess as you're keeping all the important information secret :) . . . the less information you supply the more people will have to guess rather than offer informed suggestions . . .

    Looking at your rules and guessing that your actor is not moving, and also guessing that the actor is at 0° then nothing will happen when the rules are executed as the actor's angle is never larger than 0° ?

    Or maybe your actor is rotating but it doesn't rotate as you expect it to (the phrase 'is not working' is about as vague as you can get with code :)) ), maybe 'not working' means it goes the wrong way, or stops unexpectedly, or doesn't rotate at all ?

    The rules seem to say that if the actor is at any other angle than 0° then it will rotate to 0° - and if it is at 0° it will not rotate at all.
  • limes336limes336 Member Posts: 10
    . . . this rule is not working: [if (self.rotation) > 0] I wondering if the attribute self.rotation is relative to the actor instead of the scene . . .
    self.rotaton is relative to the scene.
    . . but there is no apparent way to change this, and im not even sure this is the problem. Please help!
    I can only make a guess as you're keeping all the important information secret :) . . . the less information you supply the more people will have to guess rather than offer informed suggestions . . .

    Looking at your rules and guessing that your actor is not moving, and also guessing that the actor is at 0° then nothing will happen when the rules are executed as the actor's angle is never larger than 0° ?

    Or maybe your actor is rotating but it doesn't rotate as you expect it to (the phrase 'is not working' is about as vague as you can get with code :)) ), maybe 'not working' means it goes the wrong way, or stops unexpectedly, or doesn't rotate at all ?

    The rules seem to say that if the actor is at any other angle than 0° then it will rotate to 0° - and if it is at 0° it will not rotate at all.
    Ahh, well sorry I did not give much information, but the rest of my script does not concern this. You answered my question about self.rotation, but that does not end up fixing my problem.
    Theres is more script, that controls movement, and yes, rotation but the problem is this particular script. Your conclusion sums up what it is supposed to do, but no matter what, it never corrects its self to 0 degrees, or even movies ONE degree. Can you see anything wrong with the code in the pic i've shown? None of the other code would help you find the problem. Thanks.
  • SocksSocks London, UK.Member Posts: 12,822
    @limes336
    Can you see anything wrong with the code in the pic i've shown? None of the other code would help you find the problem. Thanks.
    Your code looks fine from what I can see, it should do what you say (correct itself to 0°) . . . hold on let me test it . . . . .
  • SocksSocks London, UK.Member Posts: 12,822
    Seems to work ok for me . . . ?

    image
  • limes336limes336 Member Posts: 10
    Seems to work ok for me . . . ?

    image
    interesting! when i turn of the other scripts in the actor it works! thanks for the help!
Sign In or Register to comment.