Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: HyperExc on September 29, 2015, 05:31:07 AM

Title: How to 'Get Position' of a Prefab (Clone)?
Post by: HyperExc 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.
Title: Re: How to 'Get Position' of a Prefab (Clone)?
Post by: Lane 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.