What is the coding to make a custom enemy freeze when the player looks at it?

I have a code written that spawns in a custom model once the players gets close and it will follow the player until the player dies but i want to know how to add into the code that if the player is look at the custom enemy then the enemy will freeze in place until the player is looking away

1 Like

One way would be to use a perception device attached to the player

could u help me figure out how to attach the perception device to my custom enemy when it spawns in from a zombie spawner. im new to uefn and not sure how to do this complicated stuff yet lol. please and thank you

1 Like

You need to actually retrieve the location of the fort_character of the zombie once it has been spawned through the creature_spawner_device.SpawnedEvent() and then apply a TeleportTo[] on the perception trigger on each tick

Can’t help you much, hope you find your way!

@im_a_lama thanks but is there a chance u could write out the full code for me im new and not good at coding. if u dont want to or cant its perfectly okay. thanks

1 Like

Sorry you gotta learn a bit, maybe someone else wants to do it :man_shrugging: