(SOLVED)External layout not spawning fast enough

I’m trying to make it that the player spawns to the position of a certain object at the beginning of the scene. Only problem is that the object is loading from an external layout, which leads to the player spawning at 0, 0. Judging by the fact that spawning at the object works correctly in every other instance, I can only assume the issue is that the external layout is loaded after the first frame of the scene.

Does anyone know any fixes, or ways to solve the issue?


Code I used for spawning players:

image

Code for loading external layout

From the screenshots, it shows that both events happen at the same time, so maybe I should add a delay to the player spawning?

Hi @Yhac10 .you could either try a 'number of instances of spawner greater than 1 as a condition to move player or send player to spawner Y()-20 or …hide player use a scene timer greater than timedelta and then show player, or turn off platform behavior at beginning of scene and turn on again when player moves to spawner or have the player on the external layout. I don’t think that you can refer to objects created in an external layout in the same event as they’re created …but it doesn’t look as if you,'ve done that.

1 Like

Thanks for the suggestions. While the suggestion about having the player in the external event is risky for me, as I don’t know how it will affect the online multiplayer, that and the way I set up the level system, your suggestion did remind me that I could just move the spawn point to the main scene instead of an event. The reason I put this of is because I would have the spawn point in the main scenes, while having the checkpoint and other points be in the external layout, although now that I think about it, it shouldn’t matter to much.

2 Likes

What is the order of your events on the event sheet? Is the layout added before the player is positioned?

I can’t tell from your screenshot if they’re subevents or if they’re placed in the event sheet in the order that you posted them. The location matters even with the at the beginning condition.

You can do them at the same time but just remember that layouts aren’t added until after an event, so they’re not available immediately in the event or subevents.

This wouldn’t work

At the beginning
… Add layout
… … Position player using spawn object

But this should

At the beginning
… Add layout
… Position player using spawn object

In the 2nd one they’re in seperate subevents but at equal indentations. Putting them in the same subevent also doesn’t work.

1 Like

Tried, maybe I got the order wrong but it didn’t work

I created a quick test project. It works for me.

This works.

While this doesn’t bc layouts don’t get created in the same event.

Also, make sure there is only 1 target object. Otherwise, it will use the oldest create object.

In my test the SpawnPoint object is inside the layout and the player is in the scene.

2 Likes

Thanks for the solution, although it wouldn’t really work for me since both the events I use to spawn playertypes and external layouts are in two different event sheets (one in an external event sheet and another in a scene event sheet)

It shouldn’t be an issue with the way layouts are added then, it’s probably the sequence that the events are triggered. The layout needs to be added first.

1 Like

Yeah I figured that. Managed to fix the issue by moving the spawn point to the main scene instead of the layout. Thanks for the help.

2 Likes