Jump to content
Sign in to follow this  
woodstock

SetPos not working for backpack, works fine in reverse

Recommended Posts

So, I'm attempting to trigger the delivery of a loaded backpack, generated on startup, to a player, on a trigger.

Using the "usual" syntax in the trigger onact, I can setpos my player to the backpack, but not the backpack (or any other item, vehicle, etc) to the player ( getPos).

What gives?

Share this post


Link to post
Share on other sites


_backpack setPosATL (getPosWorld player_name)

If you are doing this for MP, give your player a name such as "player_name". Else if its SP, replace player_name with just player.

Share this post


Link to post
Share on other sites

And what's the right way to define which backpack? I'm setting up for a whole squad with unique packs for each player. Thanks!

Share this post


Link to post
Share on other sites

Retuning a "Local variable in global space" error.

 

_MedicPack setPosATL (getPosWorld player_ReconMedic); hint "Trigger"

 

If I remove the first underscore, there's no error but nothing happens. If I transpose the units, the player gets transported to a seemingly random location, nowhere near the backpack.

 

This is how I got my player to his backpack in testing:

 

ReconMedic setpos (MedicPack modelToWorld [0,0,0]); hint "TRIGGER";

 

Again, this is just in a trigger action, not a script. I'm afraid I'm very new to all of it.

Share this post


Link to post
Share on other sites

Give each backpack a name

 

backpack3  setpos  getpos  blue3

 

.

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  

×