x


Character Loading Location

I have a series of Levels. They are activated by walking through collision boxes which then loads the next scene(Pretty simple)

The problem I'm having is that when I load from "Scene 2" back to "Scene 1" it naturally spawns the character at the origional game starting location. I want it to spawn him right outside the door (the door that leads between scene 1 and 2)

I'm trying to work the script but I just don't know how to do it.

more ▼

asked Mar 04 '10 at 10:06 PM

CalledToGaming gravatar image

CalledToGaming
190 21 24 30

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

In your levels you should define spawn points at every "door". Then you can create a GameObject that "survives" Application.LoadLevel(). You can do this by calling GameObject.DontDestroyOnLoad(MyObject).
In that GO you could store something like lastLevel. Now if you load a new level you can look up last level and spawn the player at the correct spawn point.

more ▼

answered Mar 05 '10 at 09:25 AM

StephanK gravatar image

StephanK
6k 39 53 93

Nothing i do seems to be working. I Understand the concept. But everything I try ends in the same results I'm having. Something's just not working. It's putting a big halt on my game project.

Mar 06 '10 at 08:30 AM CalledToGaming

Can you describe what's happening or what exactly is not working? What's the result you are having?

Mar 06 '10 at 10:59 AM StephanK

I don't know exactly, I guess I just dont' know how to make spawn points, and then tell the system, "when you load Scene 1, from Scene 2, Place Character here, but when you load scene 1 from scene 3, place him here instead.". That's pretty much exactly what I'm looking for at the moment.

Mar 07 '10 at 08:06 AM CalledToGaming
(comments are locked)
10|3000 characters needed characters left

you could duplicate all scenes and put you character in the places you want to spawn them in and make the script load the scene that has the right spawn in it. alot of work but thts what i do plus im a terible scripter so i do the stuuf like that prety much all the time

more ▼

answered Jan 31 at 11:52 PM

Ty1ensen gravatar image

Ty1ensen
1 1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3328
x440
x322

asked: Mar 04 '10 at 10:06 PM

Seen: 1529 times

Last Updated: Jan 31 at 11:52 PM