How do I get a character to "slide"....?

I am looking to get my actor to "slide" with the PRESS of a button (fire and forget). But all I can seem to get it to do at this point is move while the direction key is HELD down. The type of movement I'm looking for is similar to Castlevania SOTN, where Alucard can slide backwards to dodge. In my game when you DUCK it changes the Jump function into a Slide function in order to avoid traps. Basically I need one touch movement in a direction for a specified distance.

Thanks in advance.

Chris

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    Use 'Move To' - relative to actor - with 'Run to completion' checked.

  • dooleyret@yahoo.comdooleyret@yahoo.com Member Posts: 6
    edited August 2016

    I'm sorry but all that does is shoot the character off towards the Right with no stopping. I have the speed at 300, does that matter.

    Edit:
    player.position.X +64 player.position.Y
    300 run to completion

    that is how i have the "Move To" set up.
    if i Uncheck run to completion i have to hold down space to make him move, but he stops when i let go... lol

    Thanks again.

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    @dooleyret@yahoo.com said:
    I'm sorry but all that does is shoot the character off towards the Right with no stopping.

    If you have it set up as I described the character will move a fixed distance (as defined in the X and Y coordinates) and then stop.

    @dooleyret@yahoo.com said:>
    I have the speed at 300, does that matter.

    The Speed setting defines the speed at which the actor will move to its destination.

    @dooleyret@yahoo.com said:>
    player.position.X +64 player.position.Y
    300 run to completion

    It's not clear what this means, are you able to take a screenshot and post it here ?

  • Here is the screenshot. It's all in there like you suggested. I even tried it out with a blank game. I only had a white square actor. I told it to Move To actor.X +64 and actor.Y(so a straight line right.) and it just shot off the screen.

    Thanks again.

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    @dooleyret@yahoo.com said:

    Tinypic indeed ! :)

    @dooleyret@yahoo.com said:
    Here is the screenshot. It's all in there like you suggested. I even tried it out with a blank game. I only had a white square actor. I told it to Move To actor.X +64 and actor.Y(so a straight line right.) and it just shot off the screen.

    Yes, it will shoot off the screen with your settings, you are telling it to move to where it currently is (actor.X) plus 64 pixels.

    So it's moving 64 pixels every frame, and as there are 60 frames in a second, this means the actor will have travelled 64*60 pixels after 1 second !! (a very long long way !!).

    If you want the actor to move 64 pixels on the X axis just type 64 in to the X field.

  • So 'Move To' was too buggy. I went with Interpolate instead and it worked like a charm. Thanks for your help, i'll revisit 'Move To' later on and see what I can do with it.

    Thanks for the help!

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    @dooleyret@yahoo.com said:
    So 'Move To' was too buggy.

    Move To is not at all buggy, it was doing exactly what you'd asked it to do, you were asking it to move 64 pixels on every frame, so 64 pixels every 1/60th of a second.

    @dooleyret@yahoo.com said:
    I went with Interpolate instead and it worked like a charm.

    Interpolate can be problematic in that it works outside of the physics engine, for example collision detection is less reliable, the interpolation cannot be interrupted and so on.

    But at the end of the day if it works for what you need then good !

  • Well that is much better explanation than the tooltip within game salad. It says it moves the object to a "specified" (x, y), that's why I was including the object.x +64. lol I will try this out the other way. Thanks for your reply and explanation!

  • ToqueToque Member Posts: 1,187
    edited August 2016

    Here is a simple demo to slide to the right. Mac.

    https://www.dropbox.com/sh/qaq0pu3m9fmwvx4/AADZfYQ-ODYZ-JvmewpCOSNQa?dl=0

  • Just putting the number '64' worked perfectly. Adding the player's 'X' coord is what was messing it all up. Thanks for the demo and explanations!

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

    @dooleyret@yahoo.com said:
    Well that is much better explanation than the tooltip within game salad. It says it moves the object to a "specified" (x, y), that's why I was including the object.x +64.

    The tooltip is actually right, I think you are confusing 'relative to scene' and 'relative to actor'.

Sign In or Register to comment.