playMaker

Author Topic: simple spawn problem? game object not being set as location  (Read 2199 times)

krane

  • Junior Playmaker
  • **
  • Posts: 63
simple spawn problem? game object not being set as location
« on: February 28, 2017, 02:09:04 PM »
I'm still having problems with a simple spawn.

I have an empty game object, "spawnPoint".
On the spawnPoint's FSM, I have Get Owner (and store the location as spawnLoc).
I then have Get Random Child to get a random game object to spawn, which gets saved as randomObj.
I then have Create Object  with randomObj as my object to create and spawnLoc as my spawnpoint.

The object is created in my hierarchy, but not at my spawnLoc.
I can't even find it in the scene anywhere.

MajorIdea

  • Full Member
  • ***
  • Posts: 131
Re: simple spawn problem? game object not being set as location
« Reply #1 on: February 28, 2017, 07:26:37 PM »
Not sure I understand the structure but it seems to me like you may need to convert a position from local space to world space (Transform Position action).

krane

  • Junior Playmaker
  • **
  • Posts: 63
Re: simple spawn problem? game object not being set as location
« Reply #2 on: February 28, 2017, 07:44:07 PM »
Thanks, but with create object, you can set a game object as a location point, no? That's what the "spawn point" is for?  I don't see where converting from world to screen would come into it if I've already positioned the game object to spawn at.

Maybe I should specify I'm in 2D, but right now I've taken it even more simply to creating an empty game object, and on the FSM for that object, using create object and setting spawn point to an empty game object (dragging it from hierarchy to spawn point)  and it's still not spawning.

The game object is on a canvas panel.

Can someone show me a simple 2d spawner???
« Last Edit: March 01, 2017, 12:17:58 PM by krane »

krane

  • Junior Playmaker
  • **
  • Posts: 63
Re: simple spawn problem? game object not being set as location
« Reply #3 on: March 01, 2017, 01:02:41 PM »
Update: Not sure if this counts as "Solved" or not, but I found if i used create object advanced and parented the item to the canvas then it works.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: simple spawn problem? game object not being set as location
« Reply #4 on: March 03, 2017, 06:18:29 AM »
Hi,

 yes, parenting inside canvas is tricky, I use SetTransformParent custom action ( from the ecosystem) for everything inside a UI canvas.

 Bye,

 Jean