Forum begins after the advertisement:
[Part 5] Slash Effect Display & Scene Transition Bug
Home › Forums › Video Game Tutorial Series › Creating a Metroidvania in Unity › [Part 5] Slash Effect Display & Scene Transition Bug
- This topic has 6 replies, 3 voices, and was last updated 8 months, 1 week ago by Siyuan Chen.
-
AuthorPosts
-
May 14, 2024 at 12:41 am #14639::
Hi, I just pick up where I left and I am now around 32:00 at Part 5. I am getting a bit confused by stuffs I have done several weeks ago.
Problem 1. My background / midground / foreground layers seem to be working well. But the player’s slash effect will be covered behind and only behind the column in the background.
View post on imgur.com
Problem 2. After a scene transition, the player keeps moving and cannot be controlled. It possesses the same speed and direction with the moment of transition. For example, if I walk into the transition hitbox, the player performs the speed of walking after the transition. If I dash into the transition hitbox, the player performs the speed of dashing (which is super fast) instead. Strange thing is, I did this part like 3 weeks ago and I don’t remember having this problem before. But when I opened the project now, this problem seems to come from nowhere.
I can provide more video clips or screenshots if needed. Thanks in advance.
May 14, 2024 at 12:01 pm #14645::Hi Siyuan, for the first problem, when your sword slashes spawn in game, pause it and try to tweak the Inspector attributes until you get it to show up. This should help you find what the issue is.
May 14, 2024 at 1:32 pm #14649::I’d like to add, for the first problem, could you check if your slash effect prefab’s sprite renderer’s sorting layer is Midground, o at least above the other sorting layers of your background elements.
As for the second problem, Check if your pstate’s cutscene bool is true after scene transition. If it is, Check that your SceneTransition.cs has
StartCoroutine(PlayerController.Instance.WalkIntoNewScene(exitDirection, exitTime));
or that your
WalkIntoNewScene()
method in the PlayerController.cs haspState.cutscene = false;
. The problem is likely cause by yourUpdate()
method being returned contantly due to cutscene being true, thus yourMove()
method cant reset your rigidbody2D velocity to 0.May 16, 2024 at 9:51 pm #14686::Thanks for the replies, Terence and Joseph! The first problem was solved by adjusting the sorting layer, and the second was me testing the transition without having a SceneTransition object in Cave_2. I will be working into the next part soon.
May 16, 2024 at 10:23 pm #14687::Emm.. One more tiny question. Should I adjust the position of every starting point object? If I leave them where they are created, the first thing happen after a scene transition is the player colliding with the scene transition object in the new scene, and being sent back to where it comes from.
May 16, 2024 at 10:35 pm #14689::Yes, you should move the start points outside of your transition’s collider to avoid issues. The transition prefabs will act as the colliders to activate the scene transition cutscene, while the Start Points will be the position that the Player will spawn in from using the exit direction to guide the player.
May 16, 2024 at 11:22 pm #14690 -
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: