Change attribute bug ?

13»

Comments

  • zweg25zweg25 Member Posts: 738

    If your still having trouble trying interpolating it back in 0 seconds.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @RondoRocket @BBEnk @jamie_c @timolapre1998 @LumpApps @natzuur @StormyStudio @RThurman @Armelline (and anyone else who has thrown in their 2¢ (or 0.014 €)

    I now seem to be having another similar, perhaps even related, issue, here's the logic . . . .

    . . .

    1) When a key is pressed (or the actor is touched, or an attribute equals a certain value, or any trigger whatsoever . . . )

    2) Then change the angular velocity to 100

    3) Otherwise Interpolate the angular velocity to 0 over 2 seconds

    . . .

    Which looks like this . . . . . .

    . . .

    I want to be able to rotate an object, and when I release the key (or button, or the attribute that triggers it becomes false - etc) I want the object's rotation (via angular velocity) to slowly settle to a stop.

    The problem is it doesn't work - very occasionally, after hitting refresh 10 or 15 times, it might work, but most of the time it just moves a tiny bit (a degree or two) and then stops.

    Anyone got any useful insights . . . . ?

    (I'll make a video and post it in a minute).

  • SocksSocks London, UK.Member Posts: 12,822

    Video . . .

  • scuurproscuurpro Member, PRO Posts: 63
    edited May 2014

    @socks I got the same problem as you did when I tried. Also did the same thing when I used both rotate behaviors

  • SocksSocks London, UK.Member Posts: 12,822

    @scuurpro said:
    socks I got the same problem as you did when I tried. Also did the same thing when I used both rotate behaviors

    Cheers for checking . Yes, I also found that using Rotate instead of 'change angular velocity' made no difference, it still wouldn't work.

  • scuurproscuurpro Member, PRO Posts: 63
    edited May 2014

    @Socks said:
    Cheers for checking . Yes, I also found that using Rotate instead of 'change angular velocity' made no difference, it still wouldn't work.

    Maybe a change attribute with the formula for Interpolate in the expression editor?

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @scuurpro said:
    Maybe a change attribute with the formula for Interpolate?

    I tried that, no luck, it still won't work . . . .

  • scuurproscuurpro Member, PRO Posts: 63
    edited May 2014

    @Socks‌ I tried something similar to that as well didn't work. Their must be a big change attribute bug because I have a had a few things not work that should have.

  • scuurproscuurpro Member, PRO Posts: 63
    edited May 2014

    @‌Socks

    It rotates with this method I am not sure that it would come to a gradual stop. When you use interpolate it freezes for 2 seconds.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    This is a different thing than the the original bug in this thread. In this case the interpolate behavior is acting as designed. (It won't release the interpolation until it reaches its goal and/or duration.)

    You will need to find a way to turn off the interpolation behavior to get this to work.

  • RondoRocketRondoRocket Member Posts: 411
    edited May 2014

    @Socks‌ you can use Angular Drag to slow down the actor... Assuming you are okay with using physics and you don't need it to be exactly like your video. :neutral_face:

  • scuurproscuurpro Member, PRO Posts: 63
    edited May 2014

    @Socks‌ I got it to work :D

  • SocksSocks London, UK.Member Posts: 12,822

    @RThurman said:
    This is a different thing than the the original bug in this thread. In this case the interpolate behavior is acting as designed. (It won't release the interpolation until it reaches its goal and/or duration.)

    You will need to find a way to turn off the interpolation behavior to get this to work.

    Yes, that makes sense ! Thanks.

  • SocksSocks London, UK.Member Posts: 12,822

    @RondoRocket said:
    Socks‌ you can use Angular Drag to slow down the actor... Assuming you are okay with using physics and you don't need it to be exactly like your video. :neutral_face:

    Yes, I think one of the first alternative I tried was Angular Drag - but I had a few issues with it (the example I've given above is a stripped down and simplified version of the issue).

  • SocksSocks London, UK.Member Posts: 12,822

    @scuurpro said:
    Socks‌ I got it to work

    Cheers for the help.

    I copied (and double checked) all the code, that doesn't seem to work for me - it works sometimes, other times it stops working after one or two presses of the space bar . . ?

  • RondoRocketRondoRocket Member Posts: 411

    @Socks said:
    Yes, I think one of the first alternative I tried was Angular Drag - but I had a few issues with it (the example I've given above is a stripped down and simplified version of the issue).

    You had a problem with this?

  • scuurproscuurpro Member, PRO Posts: 63

    @socks Heres my code I maybe I did something and didn't realize it.

  • SocksSocks London, UK.Member Posts: 12,822

    @RondoRocket said:
    You had a problem with this?

    Yeah, I think my version using Angular Drag was identical - I can't remember quite what the issue was (I've tried so many different methods - they are all now merging into one in my memory !) - I think it had something to do with the fact that I have left and right rotation (CW and CCW) controls - and there was an issue ! Anyhow, I'll give it another shot, in theory it should work, cheers for the help.

  • SocksSocks London, UK.Member Posts: 12,822

    @scuurpro said:
    socks Heres my code I maybe I did something and didn't realize it.

    Yeah, that's exhibiting the same issues, try starting the rotation, then as it is still going - or settling down - hit the same key again (this is a game control that will be rapidly hit) - it goes all glitchy !! Like RThurman pointed out, the Interpolate needs to complete its interpolation before you can do anything else.

  • beefy_clyrobeefy_clyro Member Posts: 5,390

    @socks This one was easy fella …. Don't know if you know or not but basically there's a magic formula that works for all … AAA*sin( self.Time *BBB)+CCC … You're welcome ;)

  • SocksSocks London, UK.Member Posts: 12,822

    @beefy_clyro said:
    socks This one was easy fella …. Don't know if you know or not but basically there's a magic formula that works for all … AAA*sin( self.Time *BBB)+CCC … You're welcome ;)

    :p Lol.

    Believe me, if I could shoehorn it in there I would . . . . . :)

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    @beefy_clyro said:
    socks This one was easy fella …. Don't know if you know or not but basically there's a magic formula that works for all … AAA*sin( self.Time *BBB)+CCC … You're welcome ;)

    @Socks said:

    :p Lol.

    Believe me, if I could shoehorn it in there I would . . . . . :)

    Um.... that is the formula for interpolations. You can use it! But it will give an ease-out interpolation, rather than the linear one you are after.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    edited June 2014

    This is probably a slight thread hijack. But I think it might be useful in resolving the two 'bugs' mentioned in this thread.

    @Socks, your famous equation mentioned by @beefy_clyro‌ is actually a formula for doing interpolations. Elsewhere, you have demonstrated that an actor can have cyclical behaviors of all sorts by using a the sin() function in this equation:

    AAA*sin(Time*BBB)+CCC

    Because of the sin() function, the actor interpolates an attribute (like width, angle, position, or color) around and around in a circular pattern.

    Think about it. This equation is an interpolation. But it keeps going because there is not timer to turn it off. And it keeps repeating in a circular fashion because its uses the sin() function.

    The only thing that makes it different from the behavior that GameSalad provides, is that the GS behavior has a timer (the duration) built into it.

    Attached is a file that shows the two 'bugs' described in this thread, But, instead of using the interpolate behavior, they are re-created using using a variant of the famous "Socks' Equation". Here is the form of the equation used in the attached file:

    AAA = range
    BBB = duration
    CCC = starting value
    
    AAA*(Time*(1/BBB))+CCC
    

    Look familiar? Only two little changes from the original equation and you have a linear interpolation!

    Cool stuff!

    (Ahem... Sorry for the hijack.)

  • SocksSocks London, UK.Member Posts: 12,822
    edited June 2014

    @RThurman said:
    This is probably a slight thread hijack. But I think it might be useful in resolving the two 'bugs' mentioned in this thread

    You've not attached anything, but it'd good to see what you've come up with ! What I have at the moment is not ideal, any cool ideas accepted !!

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879
    edited June 2014

    Strange... It was there a minute ago. Lets try again.

    Edit -- Now its back. On both posts. Go figure!

  • SocksSocks London, UK.Member Posts: 12,822

    @RThurman said:
    Strange... It was there a minute ago. Lets try again.

    Edit -- Now its back. On both posts. Go figure!

    Very nice, cheers for sharing that, I'm sure it'll come in useful at some stage.

    :)

  • colandercolander Member Posts: 1,610
    edited June 2014

    @RThurman @ForumNinja (See RThurman post above) I have noticed this too, when I come back to a thread my upload is not visible. When I upload again it the original upload is visible again along with the new upload. Strange behaviour.

  • ForumNinjaForumNinja Key Master, Head Chef, Member, PRO Posts: 554

    @colander‌ That IS strange. I haven't had it happen to me personally, but I may shoot a message over to Vanilla to see if they know of any issues like this.

Sign In or Register to comment.