playMaker

Author Topic: How do I use the Get Posotion Variable? [Solved]  (Read 1443 times)

koop4

  • Playmaker Newbie
  • *
  • Posts: 5
How do I use the Get Posotion Variable? [Solved]
« on: March 10, 2014, 10:57:56 AM »
Hi everyone!
In my project i have some object which i would use to generate objects.
The "Get Position" Reference says:
"Gets the position of a game object and stores each axis in a float variable"
I would like to know how can i use this variable in my next action "Create Object", because it generate the prefabs in the 0,0,0 world position.

Thanks in Advance.
Rob
« Last Edit: March 10, 2014, 11:17:45 AM by koop4 »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do I use the Get Posotion Variable?
« Reply #1 on: March 10, 2014, 11:10:41 AM »
Get position can grab and store the world position of a Game Object in the scene, so essentially you use Get Position to find out where something is located at in the world with coordinates on the X, Y and Z planes and then keep those coordinates either separately in 3 unique floats or all together in a vector3 variable. Vector3's can be thought of like basically just 3 floats grouped together.

Once you have a position in the world and have saved some coordinates you can use the Create Object action to bring something into the scene. It needs to know where to put it, so you just tell it to use those coordinates you saved. You can also specify a game object as the target spawn point, which is usually easier because you can just place and empty game object in the scene and target it for your spawns.

Make sense?

Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

koop4

  • Playmaker Newbie
  • *
  • Posts: 5
Re: How do I use the Get Posotion Variable?
« Reply #2 on: March 10, 2014, 11:17:28 AM »
Yes, I was hoping it was possible to obtain the location and use it without storing in a variable.
Thanks sir!