Jump to content
Sign in to follow this  
goldblaze

make trigger follow player

Recommended Posts

Hello, I'm trying to make a trigger follow a player, so far I've tried the code line on act: this attachTo [player1]; not sure what I did wrong but it wont attach to the player, any help?

Share this post


Link to post
Share on other sites
try thisTrigger instead of this

Doesn't look like it works, I'm trying to get a trigger attached to add editing area so the editable area will follow the player acting as zeus around, maybe I'm setting the trigger incorrectly. The activation is set to none and condition is set to this, if that helps.

Share this post


Link to post
Share on other sites

so how are you making the trigger to activate and execute attachto if you set activation to none?

Share this post


Link to post
Share on other sites

Even when set to anyone it doesn't seem to work.

---------- Post added at 10:13 AM ---------- Previous post was at 09:44 AM ----------

set the trigger to anyone for to trigger for now, trying thisTrigger setPos [getPos player1]; I'm probably doing the getPos wrong somehow as it gives me a error that only one array is filled.

Edited by goldblaze

Share this post


Link to post
Share on other sites

Usually you attach the trigger from out side the trigger.

1st you give the trigger a name then in a game logic init you would put

triggersname attachto [player,[0,0,0]];

If you use

triggersname attachto [player];

it will attach to the player but it will be relative to the player not directly on him unless he is inside it when attached.

Share this post


Link to post
Share on other sites

I got the issue fixed with thisTrigger setPos (getPose player1); but I found what I want to do isn't effected by the trigger after init, so I'm off to zeus editing to ask, thanks for your help killzone, :)

Share this post


Link to post
Share on other sites
Usually you attach the trigger from out side the trigger.

Doing this from inside works just fine, thisTrigger is as good as the name var you give it in editor.

Share this post


Link to post
Share on other sites

IIRC some triggers cannot be moved, once the game is initialized. That was the case of the guard trigger unless it has changed recently.

Share this post


Link to post
Share on other sites
IIRC some triggers cannot be moved, once the game is initialized. That was the case of the guard trigger unless it has changed recently.

Seems guard triggers are not your normal triggers. They are not even "EmptyDetectors" and giving it a name in editor doesn't create a variable with trigger object. So I'm kinda curious how were you trying to move it?

Share this post


Link to post
Share on other sites
Seems guard triggers are not your normal triggers. They are not even "EmptyDetectors" and giving it a name in editor doesn't create a variable with trigger object. So I'm kinda curious how were you trying to move it?

Last time i tried, it was with a setpos command.

Share this post


Link to post
Share on other sites
Last time i tried, it was with a setpos command.

I understand this, setPos needs argument, <trigger> setPos ...., it is the <trigger> object I'm curious about, where did you get that?

Share this post


Link to post
Share on other sites
I understand this, setPos needs argument, <trigger> setPos ...., it is the <trigger> object I'm curious about, where did you get that?

I simply named it in the editor. Didn't know it wasn't creating a variable.

Share this post


Link to post
Share on other sites
Doing this from inside works just fine, thisTrigger is as good as the name var you give it in editor.

I know it would work but it seems a little odd to have it attach itself as every time the trigger fires it's running more code than is needed and it makes using the condition more complex as it won't fire again until original condition changes.

Share this post


Link to post
Share on other sites
I know it would work but it seems a little odd to have it attach itself as every time the trigger fires it's running more code than is needed and it makes using the condition more complex as it won't fire again until original condition changes.

He wanted trigger to attach on act, that is one off really unless set to repeated activation.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×