Jump to content
Alpine_gremlin

Create an Object at the Player`s Cursor?

Recommended Posts

Good morning guys! I was wondering if there was a command that I could use along with createVehicle in order to have an object spawn where a player places their cursor. "Position player" works well enough but I was wondering if there was a more precise command. Any help would be appreciated! Cheers!

Share this post


Link to post
Share on other sites

"B_MRAP_01_F" createVehicle  screenToWorld [0.5,0.5]; This will create a Hunter wherever the player executing the command is looking.

"B_MRAP_01_F" createVehicle  screenToWorld getMousePosition; Will create a Hunter wherever the player executing the command has their cursor at on the screen.

 

I hope that helps.

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, rebel12340 said:

"B_MRAP_01_F" createVehicle  screenToWorld [0.5,0.5]; This will create a Hunter wherever the player executing the command is looking.

"B_MRAP_01_F" createVehicle  screenToWorld getMousePosition; Will create a Hunter wherever the player executing the command has their cursor at on the screen.

 

I hope that helps.

 

Works like a charm! Thanks, boss!

 

Just one additional question: Do you happen to know what I could use to spawn the object at a normal angle (or any other angle) relative to the player`s direction?

Share this post


Link to post
Share on other sites

Simple really:

https://community.bistudio.com/wiki/getDir

https://community.bistudio.com/wiki/setDir

 

assign the spawned object to a variable, then change its direction.

_newObj setDir getDir player;

In general, if you ever wonder if there is a command to do something specific, just look at this list:

https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, Tajin said:

Simple really:

https://community.bistudio.com/wiki/getDir

https://community.bistudio.com/wiki/setDir

 

assign the spawned object to a variable, then change its direction.


_newObj setDir getDir player;

In general, if you ever wonder if there is a command to do something specific, just look at this list:

https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3

 

Cheers! And thank you for the tip!

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

×