#How to make enemy face player.

1 messages · Page 1 of 1 (latest)

untold olive
#

let's start with step zero; how are you making the enemy recognise the player?

dusky lake
#

I was going to use the get_node thing.

#

But to be honest I just wanted to start with the enemy constantly looking at the player.

#

Then follow the player.

#

Then detect the player when in view.

untold olive
#

i assume this is a top down game

dusky lake
#

Yeah hotline miami style.

stable mountain
#

you can use look_at(player_node)

dusky lake
#

No player.position?

stable mountain
#

just a sec

#

oh mb. it is look_at(player_node.global_position)

#

and to get teh player you can use a unique name or a group

dusky lake
#

I'll have a go at it tomorrow.
Thankyou.

stable mountain
#

gl

dusky lake
#

If it doesn't work I'll come back here.

#

Oh and one more thing.

#

For the enemy should I use a character2d node or kinematic2d node?

untold olive
dusky lake
dusky lake
dusky lake
#

Is it something like this?

dusky lake
#

This was the answer.