Jump to content
cassius

pointentity

Recommended Posts

When I use pointentity to make enemies point to main character(player) it makes the enemy glide toward main character. Is this an intended feature of pointentity . When I noticed this tendency I thought I might as well use the enrmy walk animation sunce the darned thing is moving anyway.

 

 

 

 

If stopanim = False

If EntityDistance(jane,knight) < 7 And EntityDistance(jane,knight) > 1

PointEntity(knight,jane)

knight_walk()

ElseIf EntityDistance(jane,knight) < 1

PointEntity( knight,jane)

jane_attack()

knight_attack()

EndIf

EndIf

Share this post


Link to post

No it was mving without the knight_walk function,I just thought if its gonna move I might as well use thewalk function.

Share this post


Link to post

Hello team!!

After read learn page with the example and this thread I'm still trying to use and understand PointEntity... But i can't make this go to walk...

¿Could you help me? I have a scene with only 3 elements in there:

  1. A camera named: MobileCamera
  2. A model named: SpaceShip
  3. A brush called: Earth

Camera.jpg.3b35cba14962319e684f356bee9107a5.jpg

I want make MobileCamera (with Script called PointToShip.lua) always point to SpaceShip, but my code or my bad sintax doesn't work...

This is my code:

Entity1 = GetEntityByName("MobileCamera")
Entity2 = GetEntityByName("Spaceship")

function Script:Start()
	self.enabled=true
end

function Script:UpdateWorld()
	PointEntity(Entity1,Entity2)
end

I have read @Rick thread-topic about this command. But i don't understand to make success the sintax anyway...

Many thanks!!

Share this post


Link to post

This thread is from 2011. There is no PointEntity anymore, it is Point.

self.entity:Point(Entity2)

self.entity is the entity the script is attached to.

 

Share this post


Link to post

I had forgotten this thread.It was about le 2.

Its the follow function along with point that makes enemy follow main character.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...