- Home /
Camera while respawning
Hi when my character respawn my camrea isn't on him like it's supposed to it's a bit left or right. I am using Cinemachin. I am not very good at programing so i am using this simple code. I would be grateful if you can help.
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class spon : MonoBehaviour { public Transform mjspon; public Transform smrt;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter2D(Collider2D collision)
{
if(collision.transform == smrt)
{
transform.position = mjspon.position;
}
}
}
Answer by xxmassassenxx · Apr 14, 2020 at 07:37 PM
Maybe the transform on the gameobject the camera is following is a bit off?
Your answer
Follow this Question
Related Questions
Controller Button Issues 0 Answers
Problem with 2D movement. My character is moving by himself between two points... :) 1 Answer
Cinemachine camera shake on button press 0 Answers
2D Platformer Pick up and move object script help! 1 Answer
In my 2D platformer game, how would I create a height marker?, 1 Answer