How do I make an object hover & follow my player?

  • Hi,

    I want to create an object which should float or hover in the air close to my player. (e.g at the top of my player's head) I have been wondering how I will be able to achieve that. It would be really nice if you guys can help me achieve my goal here. Thank you

  • In my Game digital mist in the Arcade, players have a drone following them about.

    The concept I used is on player creation the drone gets created too and gets set with the UID of the player its tied too.

    Every tick the moving angle is set towards its player X,Y - 150 (in my game representing the position above the player)

    If the distance between player and drone is bigger then a certain distance, the drone moves towards the move angle.

  • I lerp its position to an offset of the player's position (like player. X-100, player.Y-20) then apply the sine behavior set to vertical to give a look of hovering.

  • I lerp its position to an offset of the player's position (like player. X-100, player.Y-20) then apply the sine behavior set to vertical to give a look of hovering.

    I have set the position but dont know how to apply the sine behavior set to vertical. The drone is moving above the head and following my player but it's not hovering up & down. I have added the sine behavior to the drone but can you tell me how to setup the sine movement in event sheet?

    Basically, for test purposes, I want the flying bee to follow the chicken around in a hovering state.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I know its against the rule to post again but I really want someone to help me with the last step.

  • I don't think you need to set sine to vertical every tick.

    Have it at the start of layout and set sine behavior enabled (Vertical) or something.

  • I don't think you need to set sine to vertical every tick.

    Have it at the start of layout and set sine behavior enabled (Vertical) or something.

    Thanks that kind of solved the hovering problem but now the bee (sprite4) isn't following sprite2 around the platform. I want sprite4 to follow and hover around sprite2. You can view the EventSheet I posted earlier for reference.

  • Edit..

    Ok..

    Setting the position every tick will ofcourse overwrite the sine behaviour..

    I guess adding an

    -every tick

    sprite4 move at angle(sprite4.x,sprite4.y,sprite2.x-100,sprite2.y-200)

    might get better results

    maybe adding an inverted system is between values condition to stop it when it's close enough

  • Edit..

    Ok..

    Setting the position every tick will ofcourse overwrite the sine behaviour..

    I guess adding an

    -every tick

    sprite4 move at angle(sprite4.x,sprite4.y,sprite2.x-100,sprite2.y-200)

    might get better results

    maybe adding an inverted system is between values condition to stop it when it's close enough

    I cannot post links yet so please remove the space to access the working file. Can you show me how to make it work? Just want the bee to hoveraround and follow the chicke.

    https:// dropbox.com/s/lmhcjvb5fhjr66n/ProjectOne.capx?dl=0

  • > Edit..

    >

    > Ok..

    > Setting the position every tick will ofcourse overwrite the sine behaviour..

    >

    > I guess adding an

    >

    > -every tick

    > sprite4 move at angle(sprite4.x,sprite4.y,sprite2.x-100,sprite2.y-200)

    >

    > might get better results

    >

    > maybe adding an inverted system is between values condition to stop it when it's close enough

    >

    I cannot post links yet so please remove the space to access the working file. Can you show me how to make it work? Just want the bee to hoveraround and follow the chicke.

    https:// dropbox.com/s/lmhcjvb5fhjr66n/ProjectOne.capx?dl=0

    Unfortunately your project is using the platform+ plugin which I don't have, so I'm unable to open it..

  • It's installed but i'm not using it for this project :S! I'm just using the normal platform plugin.

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