Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Gadget Gril on August 01, 2014, 05:50:09 PM

Title: Trouble creating prefabs
Post by: Gadget Gril on August 01, 2014, 05:50:09 PM
Hi, I've got something strange happening. I have a very simple state machine that is supposed to create a prefab at a certain location. I have two variables, both are game objects, one called newPrefab, and the other called SpawnPoint which refers to an empty gameObject when I want my prefab to spawn. Right now this is all my state machine does, because I figured I'd get this to work before adding more.

Here's the problem, when I play my game I get two instances of my prefab. One is right where I'd expect it to be, the other one is at origin and the sprite is cut in half along the Y axis.

Here's a picture of my state.

(http://i58.tinypic.com/2zqhe1z.jpg)
Title: Re: Trouble creating prefabs
Post by: Lane on August 11, 2014, 12:37:59 PM
Hey welcome to the forum, sorry for the delay getting a reply =)

Can you turn Debug on (checkbox on the bottom of the action stack)? It helps see whats in the fields.

Is newPrefab from the Project Hierarchy? Create Object only creates one object so its possible that you have either an object already in the scene that you're referencing or you are creating another object by some other FSM or script.