playMaker

Author Topic: How to 'Get Position' of a Prefab (Clone)?  (Read 1608 times)

HyperExc

  • Playmaker Newbie
  • *
  • Posts: 21
How to 'Get Position' of a Prefab (Clone)?
« on: September 29, 2015, 05:31:07 AM »
Hey, guys!

I am trying to setup a scene with the KGFCamera plug-in where the camera will focus on an object which is spawned in a different position each time. The Camera is great, but....

When I use Get Position, the action gets the position of the original prefab (which is x 0,y 0,z 0 in world space). So how does one go about getting the position of the prefab (clone) which is spawned on runtime?  It does not exist anywhere in the project until you hit the play button so is it even possible to get it's position in real-time? Thanks.
« Last Edit: September 29, 2015, 05:34:56 AM by HyperExc »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How to 'Get Position' of a Prefab (Clone)?
« Reply #1 on: September 29, 2015, 07:05:56 AM »
Store the Clone object as a variable when you create it, then target that stored variable.

The prefab is of course not even in the scene, so trying to tell something to look at it results in failure. You have to target something that exists.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D