About Store Forum Documentation Contact



Post Reply 
How to get player position
Author Message
DNS Offline
Member

Post: #1
How to get player position
Hi!

I have NPC strict and i want do movement this object follow player.

How get player position?

I try use this

Reference<Player> target;

and in update

actionMoveTo(target.pos());

but this does not work.

error C2039: 'pos' : is not a member of 'EE::Reference<TYPE>'
07-17-2012 08:01 PM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #2
RE: How to get player position
actionMoveTo(Players[0].pos);, or , actionMoveTo(plr.pos());

Man, it's always that semicolon...
07-17-2012 09:36 PM
Visit this user's website Find all posts by this user Quote this message in a reply
neo22 Offline
Member

Post: #3
RE: How to get player position
Hello,

you're using the template Reference<TYPE>, so use the operator () to get the value like this :
Code:
if(target.valid())actionMoveTo(target().pos());
07-22-2012 06:30 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply