playMaker

Author Topic: [SOLVED] Load Level then find loaded object  (Read 1859 times)

thatnzguy

  • Playmaker Newbie
  • *
  • Posts: 43
[SOLVED] Load Level then find loaded object
« on: April 08, 2015, 01:37:10 AM »
I want to load a scene that just has one gameObject in it, and then parent that gameObject to one in the main scene.
I'm using Load Level and then Find Game Object, however it appears the level actually appears in the scene one frame after the Level Loaded event is fired. Which means that I cannot find the game object because it exists one frame after I look for it.

Any tips on what I could do would be greatly appreciated.
Cheers!
« Last Edit: April 20, 2015, 07:46:35 PM by thatnzguy »

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Load Level then find loaded object
« Reply #1 on: April 09, 2015, 09:47:49 AM »
You can just have the Load level on its own state with a wait action with a short time like 0.5 seconds- then the find object on the next state linked to the wait action
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

thatnzguy

  • Playmaker Newbie
  • *
  • Posts: 43
Re: Load Level then find loaded object
« Reply #2 on: April 09, 2015, 07:13:15 PM »
Using a wait action isn't ideal, I ended up using Async to resolve the problem. It fires the finished event correctly after the level is loaded in.

Cheers!