1st timer HELP Please

brett-nortonbrett-norton Posts: 64Member, BASIC


I would like to start by saying this engine is awesome for begginers.. i hope ine of you kind people can help me out.

I have a game where player is moved by clicking the screen.

I have multiple enemies moving toward the player, when the enemys touch player the player is destroyed.

When mouse button is clicked on enemy the enemy is destroyed, with the player darting across to the enemy making it look like the player killed the enemy.

All works fine however if i click beyond the enemy on accident and not directly on the enemy the player will fly through the enemy without destroying the player.

If player stands still the enemys will move to player and colide with the player and kill it.

So why does the player fly through the enemy?

Code looks like this.

Move player to mouse click

Mouse down = interpolate self possion x,y to game mouse position x,y

Player destroyed = when player colides with enemy destroy.

Enemy destroyed =

Determine self destroy
If self destroy is false
Mouse position is over actor
Mouse is down

Do set self enemy destroy to true.

Click destroy =

If self destroy is true

Do destroy actor.

Hope that makes sense.

Thanks in advance


  • pHghostpHghost London, UKPosts: 2,280Member
    edited March 2017

    When interpolating, collisions generally don't work. Use Move To instead.

  • brett-nortonbrett-norton Posts: 64Member, BASIC

    Hi pHghost i was getting more issues with move to.

    I liked the look of seeing the player move to the position. Im talking about a character with super speed that can launch to the enemy once the enemy is clicked on

    I couldnt seem to get the right attributes with move to. The player was launching past the mouse click location as if it was moving on ice. I will mess with your suggestion and
    speed and friction setting and hopefully nail it.

  • pHghostpHghost London, UKPosts: 2,280Member

    The point is that interpolation takes the actor out of the physics engine temporarily, so it simply doesn't detect collisions. The actors not being interpolated should potentially still detect the collision.

    Move to gets you around that problem, but of course, works slightly differently, so you need to figure out what works best for your situation and the functionality you need.

  • brett-nortonbrett-norton Posts: 64Member, BASIC

    Thanks, Would you suggest using the better collision? and if so would i apply it to both enemy and player or just one?

  • pHghostpHghost London, UKPosts: 2,280Member

    What do you mean by 'better collision'?

    The setting in the actor?

    That can be helpful for some physics driven games. But it won't fix this problem. Interpolation takes the actor out of the physics system completely while it runs, so nice of these settings will apply during that time.

  • brett-nortonbrett-norton Posts: 64Member, BASIC

    Yea in actor settings, As i need to rely a lot on good collision.

    Im really struggling to crack this move :( when i use move to mouse button x,y

    it runs past the initial click and goes crazy.

  • pHghostpHghost London, UKPosts: 2,280Member

    So, how is your Move To logic actually set up?

    I think you'll need to be a bit more specific if you want to be given a more helpful answer.

  • brett-nortonbrett-norton Posts: 64Member, BASIC

    Change of plan to make things run a little smoother.. i now have the following.

    When mouse is down
    Change attribute self position X and Y to game position X and Y

    Creating a quick actor/player snap from one position to another.

    But how can i make the actor "player" not move when i click on another actor "enemy"??

  • brett-nortonbrett-norton Posts: 64Member, BASIC

    Sorry the above is meant to be self position X and Y to Game mouse position X and Y

Sign In or Register to comment.