How can I transition between areas on the tilemap in a top-down RPG type of game?
Hello all,
I am new to this community and have been spending the past week learning about the basics of a 2D top down game. I am fascinated and am making progress! However, I've hit a road block. the Best way for me to describe my issue is post the link of the tutorial I am following. Placed here: https://www.youtube.com/watch?v=7xEnLB0UU68 I have only gotten as far as the first transition, not the second one for the MoveLeft.
I want my character to be able to walk into another "room" of my tilemap and there be a transition (Alot like how the Pokemon games do it.) So from what I can see (Ive watched this tutorial probably 3 times now lol), I have done everything the way he has done it. My problem is, is when I hit the trigger the camera does shift to the next scene, however when I go further forward the camer jerks to the max position coordinate and away from my player. And i notice at this point the camera stops following my character if I backtrack into the previous area. I'v sat with this so long. Here is my script:
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class AreaTransitions : MonoBehaviour { private CameraController cam;
public Vector2 newMinPos;
public Vector2 newMaxPos;
// Start is called before the first frame update
void Start()
{
cam = Camera.main.GetComponent<CameraController>();
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter2D(Collider2D other)
{
if(other.tag == "Player")
{
cam.minPosition = newMinPos;
cam.maxPosition = newMaxPos;
}
}
}
Hope this makes sense. It's kind of hard to explain.
Your answer
Follow this Question
Related Questions
Camera target-focus like Retro Affect, Nuclear Throne and Dungeon Souls! Need your help :) 0 Answers
I NEED A PROGRAMMER'S HELP 1 Answer
Messed up sprites flickering over whole screen on multiple machines while moving 0 Answers
hi, please help with camera control on android phone 0 Answers
Camera Modification Help 0 Answers