Jump to content

Pull enemy towards player


nonplusultra

Recommended Posts

Does anyone have an idea, how to pull an enemy towards the player?

 

I know about the pushactoraway negative value, but the value returns the havoc force

 

Tried it with the following script:

 

ref actor1

short pdistance

short cdistance

 

begin OnTriggerEnter

 

set actor1 to getactionref

if actor1.getinfaction playerfaction == 0

set pdistance to actor1.getdistance player

set cdistance to (0 - pdistance) *0.045

player.pushactoraway actor1 cdistance

actor1.damageav health 10

endif

 

end

 

with this script I tried to find the common denominator between the havoc force and the distance units, but no multiplicator value seems to work :/

 

so any other suggestions?

Link to comment
Share on other sites

Hmm.

 

Push the actor into the player by setting up a force behind the actor?

 

Like if 'P' symbolizes the player,

and 'A' the actor

 

and lines of force can be represented using -----> or <-----

 

imagine a scenario like this

 

P A <-------------------

 

instead of

 

P <---------------- A

Link to comment
Share on other sites

  • Recently Browsing   0 members

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