Hi there. I´ve been breaking my head with a problem i can´t solve. I have a first person small game, with two scenes, an island and a cave. I change scenes correclty when entering the cave, but on returning, no matter what PlayerStart I use, the players falls under the ground. What may be happening?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Where do they first appear once they re-enter the island scene? Are they appearing at the intended PlayerStart and then falling through the floor, or are they starting off somewhere else?
You can try pausing Unity's Play Mode just before the scene-change, and then using the One Frame Forward button at the top of the Editor to show see exactly where they're being placed when the next scene begins.
Check that the floor has a collider to stop the player from falling through it, and that the PlayerStart is above this collider.
Let's see some screenshots that illustrate the issue, as this sounds like a visual problem. Please also let me know:
Thanks Chris... I´ve positioned the PlayerStart above the terrain always. In fact i´ve configured the same PlayerStart where the player starts the game. This happens even when building the game. At first this didn´t happen, but I could not figure out what change made this happen. As I told you I have tried several PlayerStarts, in different places of the Terrain, always with the same result
So starting the game from this scene, at the same PlayerStart, causes no issue - but re-entering the scene, to the same PlayerStart, causes the issue?
If he's falling through the floor, then it's likely related to Unity's Physics system. Check the state of your colliders / rigidbodies before/after the issue occurs, since your Player should still be bound by the behaviour of those components.
Please also let me know the details I've asked for above - there's not much to go on so far, and it's a situation that seems unique to your setup. The more detail / screenshots you can share, the better advice I can give.
Update: i've started the game from the cave, and the same happens, so its not a matter of returning... I've paused Play in the transition, and clearly the Player is returning below ground, no coordinate coinciding with the PlayerStart to return to.
I cannot post an image here without uploading previously...
https://drive.google.com/open?id=13iQAZwwYDQbqi5-psMmgR6xmV4As3-QI
What I can see in the console is that the first person camera cannot be saved and that i should apply the ConstantID script... this is not possible, as the Player is spawned at runtime as you recommend from a prefab
AC ver 1.69.5
Unity 2018.4.11f1
Cuoriusly, every once and so on, the transition works and the Player returns correctly to the Island
Correct - please see the forum rules for suggestions on hosting images.
What other components are on the Player? Are any below "Footstep Sounds"?
ConstantID components can still be attached to prefabs - just open up the Player's prefab and attach a new Constant ID component to the camera, being sure to check Retain in prefab? in its Inspector.
When starting the game from this scene, the Player should appear at the "Default PlayerStart" defined in your Scene Manager. I'm assuming that this is assigned correctly - though I can't tell from your screenshot where it is exactly. It looks like it might even be inside the Box Collider.
Try these two steps:
If the answer to both of those is "no", best for me to see things for myself. If you can create a .unitypackage file of just your Managers, your Player prefab, and the scene file, PM it to me and I'll take a look.
The screenshot indicates the return from the cave to the Island. I stress the fact that the position where the Player returns has NOTHING to do with the PlayerStart, though it is near. The coordinates X,Y,Z are different.
I have modified the PlayerStart's height and temporarily solves the matter... but eventually it fails. I have even been able to advance some steps in the Island, to unexpectedly fall. SO strange.
I will try your indications and let you know... Happy New Year!