neil
New vMember
Posts: 2
|
Post by neil on Aug 9, 2016 9:41:41 GMT
Hi,
I am having problem while switching scene. The camera don't follow the character. Is there a way to solve this?
Example at scene 1. Player enter room. On loaded scene 2 Player is moving but camera is static.
|
|
|
Post by Invector on Aug 10, 2016 13:11:26 GMT
All you need to do is open the ThirdPersonController script and add a DontDestroyOnLoad on the Awake method and add the OnLevelWasLoaded, make the Init again to set up the camera target.
void Awake() { StartCoroutine("UpdateRaycast"); // limit raycasts calls for better performance DontDestroyOnLoad(transform.gameObject); }
void Start() { Init(); Cursor.visible = false; }
void OnLevelWasLoaded(int level) { Init(); }
|
|
neil
New vMember
Posts: 2
|
Post by neil on Aug 11, 2016 4:47:29 GMT
Thanks Invector. Work like a charm..!!
|
|
|
Post by Legion on Oct 3, 2016 22:59:34 GMT
This method just change between scenes, right? I mean, each scene has its own character, it doesn't instantiate the player from the first scene to the second one.
|
|
|
Post by mari4og on Sept 5, 2017 9:03:46 GMT
Hello. I didn't change the script - I made the vThirdPersonCamera prefab and moved it to another scene. It's not right? Will be bad effects?
|
|
|
Post by Invector on Sept 5, 2017 13:39:03 GMT
Hello. I didn't change the script - I made the vThirdPersonCamera prefab and moved it to another scene. It's not right? Will be bad effects? No need to, that was before we have a DontDestroyOnLoad on our scripts ;)
|
|
3k
New vMember
Posts: 14
|
Post by 3k on Jun 11, 2019 21:22:39 GMT
So what would be the right workflow if I want to start to work on a new scene and want to see the player perspective? I was about to do what mag4og did.
|
|