Forum begins after the advertisement:
Scene Transition change the scene rapidly
Home › Forums › Video Game Tutorial Series › Creating a Metroidvania in Unity › Scene Transition change the scene rapidly
- This topic has 7 replies, 2 voices, and was last updated 1 month, 1 week ago by Chloe Lim.
-
AuthorPosts
-
October 10, 2024 at 10:29 pm #16021::
Hello everyone. I just build a new scene and it come out with some error and I got some question want to ask too.
First is the error. I created 2 scenes transition and the first one work ok. The second one is like the below picture
I do the same as the first transition but when i jump to it, the scene change rapidly like the video
Video demo error
In the video i has show something you want to check like the build setting, the transition to variable, the position of the starting point.
And for the question, I want to ask that how can I make sure that if my player jump of from this scene, if will fall down in correct position if there is 2 or more scene transtion and start. Like in the video 2 got 2 scene transition and if I go up and then go down ( after I fix the error ) how can I make it drop down in the start point of the second scene trasition.
Thank you so much for the seriesOctober 11, 2024 at 12:03 pm #16029::Hi,
Do send me your script for SceneTransition to see if the issue is possibly within the script itselfOctober 11, 2024 at 1:57 pm #16030::using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class SceneTransition : MonoBehaviour { // Start is called before the first frame update [SerializeField] private string transitionTo; [SerializeField] private Transform startPoint; [SerializeField] private Vector2 directionExit; [SerializeField] private float exitTime; private void Start() { if (transitionTo == GameManager.Instance.transitionFromScene) { Move.Instance.transform.position = startPoint.position; StartCoroutine(Move.Instance.WalktonewScene(directionExit,exitTime)); } } private void OnTriggerEnter2D(Collider2D _other) { if (_other.CompareTag("Player")) { GameManager.Instance.transitionFromScene = SceneManager.GetActiveScene().name; Move.Instance.playerStateList.incutscene = true; SceneManager.LoadScene(transitionTo); } } }
here is the scene transition script
October 11, 2024 at 2:52 pm #16031::Hi, your scene transition script seems fine
Try this,
Check where is the child start point for your scene transition in the uppertunnel scene is, it can affect where the player spawns in the scene, send the screenshot of it here tooOctober 11, 2024 at 3:09 pm #16032October 11, 2024 at 5:26 pm #16035::Hi, the issue could be these things:
– There is a duplicate player in the UpperTunnel scene, so there might be a clash with that, there should only be one player prefab present within all the level scenes
– The start point might be causing the player to fall back down the previous scene, so try to adjust it such that the player will land on the platformOctober 11, 2024 at 8:28 pm #16036::Hi so it definitely because of the startpoint postion. About the player dublicated. Is that you mean that I dont need to put the player in every scene? Does I just need to put it in the start scene?
October 11, 2024 at 9:20 pm #16038 -
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: