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

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #14639
    Siyuan Chen

    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

    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.


    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.

    Joseph Tang

    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 has pState.cutscene = false;.
    The problem is likely cause by your Update() method being returned contantly due to cutscene being true, thus your Move() method cant reset your rigidbody2D velocity to 0.

    Siyuan Chen

    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.

    Siyuan Chen

    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.

    Joseph Tang

    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.

    Siyuan Chen

    Thanks!! I will move into the next part.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Go to Login Page →

Advertisement below: