playMaker

Author Topic: Create Object action issue [SOLVED]  (Read 3120 times)

MattyWS

  • Junior Playmaker
  • **
  • Posts: 90
Create Object action issue [SOLVED]
« on: July 28, 2013, 04:06:08 PM »
Hello all, I'm trying to instantiate a prefab at the location of the object with the action, but when using "Create Object" and setting the spawn point, the object created still spawns at world space 0,0,0. Is this a bug or am I doing something wrong here?

Basically what I'm doing is having a building spawn a tank every 10 seconds, so far so good apart from the spawn location. :(
« Last Edit: July 29, 2013, 03:30:59 PM by MattyWS »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Create Object action issue
« Reply #1 on: July 28, 2013, 04:15:32 PM »
Hi,

simply set its position after you create the object, it's fine. Save the reference of the object you just created, and the next action within the same state simply sets its position.

 bye,

 Jean

MattyWS

  • Junior Playmaker
  • **
  • Posts: 90
Re: Create Object action issue
« Reply #2 on: July 28, 2013, 05:48:58 PM »
Hey Jean, I'm sorry but could you possibly elaborate on that? :) I'm still but a humble noob with PlayMaker. ^^

Thanks
MattyWS

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Create Object action issue
« Reply #3 on: July 28, 2013, 05:57:15 PM »
hi,

 actually, as I went to create a sample for you, I realised I mis readed your question...

 so.. let's start again :)

 Are you using the "spawn Point" property and/or the position property in your create Object action? Can you double check that the spawn point gameObject reference is not at 0,0,0?

bye,

 Jean

MattyWS

  • Junior Playmaker
  • **
  • Posts: 90
Re: Create Object action issue
« Reply #4 on: July 28, 2013, 06:07:21 PM »
Well I tried both and both resulted in the object spawning at 0,0,0 real world. The prefab of the building that spawns the units is at 0,0,0 in the actual prefab but then it's moved around in the world (placed in different locations around the map).

Thanks
MattyWS

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Create Object action issue
« Reply #5 on: July 29, 2013, 05:06:22 AM »
hi,

 that's odd indeed. I would triple check that the gameObject you use to define the spanwing point is not at 0,0,0 and else can you double check on an empty scene that you can spawn properly at a defined position? if that works on an empty scene, then it's somewhere in your logic after you create the object that it's set back to 0,0,0

 pm me if you want me to look at your project if you are getting nowhere.

bye,

 JEan

MattyWS

  • Junior Playmaker
  • **
  • Posts: 90
Re: Create Object action issue
« Reply #6 on: July 29, 2013, 02:35:59 PM »
I think my problem was at some point I hit apply to the tank prefab when it was somewhere in the world other than 0,0,0 (opposite side of the map from the factory making it look like it was 0,0,0). I reset that and now it spawns a tank at the factory!

Sorry for wasting your time.  :-[ Thanks very much for the help though!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Create Object action issue [SOLVED]
« Reply #7 on: July 30, 2013, 06:04:47 AM »
Hi,
 
No time wasted, don't worry!

bye,

Jean