Page 1 of 1

scene portals

Posted: Sun Feb 18, 2024 5:45 am
by achuchon
Hello! Sorry because I'm very new to Unity and I would like to ask a question, I'm trying to use the pixel crushers portal, but my character doesn't move, and I've tried creating a dontdestroyonload script but it doesn't work, and I'm not sure if I have to add one to the camera, another question I have is that my game is 2D in a 3D world and I would like to know how I can direct the camera in the direction I want. My camera and my player are two separate objects, thanks :D

Re: scene portals

Posted: Sun Feb 18, 2024 9:29 am
by Tony Li
Hi,

> I'm trying to use the pixel crushers portal, but my character doesn't move

Do you mean that when your character enters the Scene Portal's trigger collider, it doesn't load the new scene? If so, make sure:
  • The character has a collider and a rigidbody.
  • The Scene Portal GameObject has a trigger collider.
  • The Scene Portal's Required Tag matches the character's Tag.
  • If you're using 2D colliders, tick the Welcome Window's USE_PHYSICS2D checkbox.
> another question I have is that my game is 2D in a 3D world and I would like to know how I can direct the camera in the direction I want. My camera and my player are two separate objects,

During conversations, you can use the Camera() sequencer command. Please see the Cutscene Sequence Tutorials.

Re: scene portals

Posted: Sun Feb 18, 2024 11:53 am
by achuchon
If the scene changes, but my player does not change the scene, the camera is lost
and the player

Re: scene portals

Posted: Sun Feb 18, 2024 1:45 pm
by Tony Li
Does your destination scene also have player and camera GameObjects?

If not, add them to the scene. The only exception is if your player or camera GameObjects are configured with DontDestroyOnLoad.