Hi guys ! I’ve been working on unity for a couple of months but I’m still a beginner to scripting (C#). I’m working on a Roll-A-Ball like game but the difference is that the camera is a fps camera. So what I’m asking for is how can I rotate my ball in the direction of my camera? What I mean is I want my balls forward to be the same with my camera’s forward. If I succeed this I will be able to make it compatible with VR platforms.

Attach this script to camera and set player from the Inspector :

using UnityEngine;

public class CameraFollower : MonoBehaviour {
    public Transform player;

    private void FixedUpdate() {
   transform.position = target.position;
   transform.rotation = Quaternion.Euler(0f,target.rotation.y, 0f);
    }
}