Dear programers of unity,
I am in a situation where finding the solution for the problem seems a bit hard. my game character is floating upwards with negative gravity. i would like the camera to follow the player going upwards and off course sideways. due to the fact that my character is leaning left and right when going sideways, the camera is following that behavior as well being a child. i would like it to only ignore the leaning part while being a child or having a separate code so it isn’t really necessarily for the camera to be a child of the player.
i have searched on this site and even though the answers seemed logical, it didn’t worked out for me.
do you have any suggestions for me to solve this problem?
can you maybe also give me directions how to implement it as i am not really experienced with coding in this begin code:
using UnityEngine;
using System.Collections;
public class CameraMovement : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
Thank you in advance!