How do I move my player

  • I will make a game and I need to move the player(sprite) to my touch positing(If I move my finger right the player move right)

    How do I move the player the same path my finger do?

  • I am unsure if what you want is the sprite to follow a path drawn by your finger, just following your finger or mimic a behavior where the sprite is "pinned" to the touch so it moves with your finger.

    To have it where you touch a place and the sprite moves towards it. Add the Pathfinding behavior to the sprite then use an action

    "On Touch" > "Find Path X: Touch.X - Y: Touch.Y"

    "On Path Found" > "Move Along the Path"

    To have it where the sprite moves all the time with your touch:

    "On Touch" > "Set Position X: Touch.X - Y: Touch.Y"

    Hope that helps.

  • I am unsure if what you want is the sprite to follow a path drawn by your finger, just following your finger or mimic a behavior where the sprite is "pinned" to the touch so it moves with your finger.

    To have it where you touch a place and the sprite moves towards it. Add the Pathfinding behavior to the sprite then use an action

    "On Touch" > "Find Path X: Touch.X - Y: Touch.Y"

    "On Path Found" > "Move Along the Path"

    To have it where the sprite moves all the time with your touch:

    "On Touch" > "Set Position X: Touch.X - Y: Touch.Y"

    Hope that helps.

    I need something like in this game:

    play.google.com/store/apps/deta ... rles&hl=en

    If I do what you say it works?

  • I make multiplayer game, im a player and every 1 second the game create a ball and the ball move to the player.

    The game work good but the peer can't move his player...

    How do i fix this?

    It is my event sheet:

  • It looks like you're using pathfinding behaviour?

    I think you have the time to locate the path set too short... every 0.1 seconds it is re-evaluating the path which will cause it not to move at all in most cases. You need to only look for a path every 1-2 seconds at least. Try that and see if it helps.

    ~Sol

  • > I am unsure if what you want is the sprite to follow a path drawn by your finger, just following your finger or mimic a behavior where the sprite is "pinned" to the touch so it moves with your finger.

    >

    > To have it where you touch a place and the sprite moves towards it. Add the Pathfinding behavior to the sprite then use an action

    > "On Touch" > "Find Path X: Touch.X - Y: Touch.Y"

    > "On Path Found" > "Move Along the Path"

    >

    > To have it where the sprite moves all the time with your touch:

    > "On Touch" > "Set Position X: Touch.X - Y: Touch.Y"

    >

    > Hope that helps.

    >

    I need something like in this game:

    https://play.google.com/store/apps/deta ... rles&hl=en

    If I do what you say it works?

    I couldn't check the game as your link is edited out (a security measure in the forums). Can you at least mention the game's name so I can check it out?

  • It looks like you're using pathfinding behaviour?

    I think you have the time to locate the path set too short... every 0.1 seconds it is re-evaluating the path which will cause it not to move at all in most cases. You need to only look for a path every 1-2 seconds at least. Try that and see if it helps.

    ~Sol

    I change this but if I change this the player only if I tap and I want the player move when I touch (tap and hold), and this not fix the problem... I can move my player but the enemy can't his player stuck.

  • >

    > > I am unsure if what you want is the sprite to follow a path drawn by your finger, just following your finger or mimic a behavior where the sprite is "pinned" to the touch so it moves with your finger.

    > >

    > > To have it where you touch a place and the sprite moves towards it. Add the Pathfinding behavior to the sprite then use an action

    > > "On Touch" > "Find Path X: Touch.X - Y: Touch.Y"

    > > "On Path Found" > "Move Along the Path"

    > >

    > > To have it where the sprite moves all the time with your touch:

    > > "On Touch" > "Set Position X: Touch.X - Y: Touch.Y"

    > >

    > > Hope that helps.

    > >

    > I need something like in this game:

    > play.google.com/store/apps/deta ... rles&hl=en

    > If I do what you say it works?

    >

    I couldn't check the game as your link is edited out (a security measure in the forums). Can you at least mention the game's name so I can check it out?

    The name of the game his "charles" and I want to move the player like in this game.

  • The enemy has the same problem... every 0.1 seconds it tries to find a path. It will never move if it has the find the path constantly. Change the time for enemy also.

    ~Sol

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You already have a thread about this problem. Please do not make multiple threads about the same issue.

    ~Sol

  • The name of the game his "charles" and I want to move the player like in this game.

    Then what you need to do is do a condition:

    Every Tick > Set Player Position X: Touch.X - Y: Touch.Y

  • The topics have been merged.

    No need to multiply topics, keep it to a single one.

    Next time, moderation will be more severe.

  • >

    >

    > The name of the game his "charles" and I want to move the player like in this game.

    >

    Then what you need to do is do a condition:

    Every Tick > Set Player Position X: Touch.X - Y: Touch.Y

    But if i do this the player jump tu the position and I want the player move to this positing

  • >

    > >

    > >

    > > The name of the game his "charles" and I want to move the player like in this game.

    > >

    >

    > Then what you need to do is do a condition:

    >

    > Every Tick > Set Player Position X: Touch.X - Y: Touch.Y

    >

    But if i do this the player jump tu the position and I want the player move to this positing

    What will happen is that the player's position will be where the touch is. So the player must keep his finger on the device at all times to move, otherwise it will stop.

    The other method is the pathfinding solution. So when the player touches a certain area, C2 calculates a path that tries to avoid solid objects and the player sprite moves along it. Thing is, I don't think you can draw your own path using that behavior. If you want to draw your own path, you might want to look at:

    or

    Hope that helps.

  • I success to move but my rival (peer) can't move his player.. the host can move the player but the peer can't.

    His player stuck.

    What to do?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)