Jump to content

How to lock an NPC in place ?


j0r00

Recommended Posts

Is there a way to lock an NPC in place so that he won't be pushed if attacked by other NPCs?

 

I tried to attach the following script code to an NPC in order to make it not moveable and not pushed around if it gets attacked But it didn't work, The NPC acts like a statue and doesn't perform any animations :(

 

 

Scriptname haltedNPC extends Actor

Event OnInit()
Actor me = Self as Actor
me.setDontMove(true)
me.setRestrained(true)
me.EnableAI(false)
EndEvent

 

Any suggestions ?

 

Link to comment
Share on other sites

Can you explain a bit more about what you are wanting the NPC to do? Is it supposed to be like a mannequin or target dummy? I'm no coder, but I imagine the no animation thing is from me.EnableAI(false).

 

Does the NPC need to show other hit events, like the weapon hitting them or causing bleeding? If not, then just enable "Is Ghost" in the actor's edit window. This will make weapons go through it, and it shouldn't cause any hit events like staggering. I'm not entirely sure what's moving the NPC when it's getting attacked though, so this may not work.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...