Roll A Ball Question: How to change the camera so it follows like a 3d platformer?

I’m onto something, I imported the standard assest’s project with camera scripts. I just don’t know where a good tutorial on youtube is, or how to edit the options and scripting to [connect the camera and the player].

If I were to remove the ball or set the camera further back. I could then use the roll a ball level, and have an extended idea to work with.

Thanks

Updated: Dragging the camera script options, from the import assests. I have attached a camera without making it myself.

The better question is - how do I find a camera where it will pivot all axis’?

I’d like to see the whole map as I follow the roll-a-ball, not just a 180

When you say “Pivot all axis” do you mean that you want to be able to rotate the camera similar ot a 1st/3rd person game and look everywhere?

Also, you mentioned about not finding any good tutorials… what exactly are you after? Perhaps I can point to one that deals with your specific queries…

Of course I would recommend going through ALL the tutorials that are available on this site as they can all teach your something useful in your fledgling projects.

I was meaning something that could be able to follow it like super monkey ball for the GameCube.

(Third Person Fixed but dynamic and free following camera)

Still not sure if I’m following you, but I’ll try to help make something that’s similar to super monkey ball.

  • Take your basic main camera.
  • Add a new script.
  • Have something like the following in the new script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerFollowScript : MonoBehaviour {

    public GameObject player;

    public float followDistance;
    public float followHeight;

    // Use this for initialization
    void Start () {
       
    }
   
    // Update is called once per frame
    void Update () {
        Vector3 newPos = player.transform.position + (-player.transform.forward * followDistance);

        newPos.y = followHeight;

        transform.position = newPos;

        transform.LookAt(player.transform.position);
    }
}
  • Back in the inspector, drag the player object to the new “Player” field for the script.
  • I’d recommend setting the followDistance and followHeight to 15 and 10 respectively.

Every frame the camera will do the following

  • Get the players location in the game and move behind the player by whatever you’ve set the distance to. (This is done by using “-player.transform.forward” - leaving out the minus will set the camera in front of the player.)
  • Set’s the cameras height to whatever you wanted it to. NOTE: if you’re going to have the player on a non-flat direciton of play then you will have to change this.
  • Finally, look directly at the player.

Hope this helps. All the best.

P.S. You could try searching for 3rd person game tutorials - this SHOULD provide some of the basic tips for a Super Monkey Ball type camera.

Ill bookmark this, as this will hopefully solve the problem

ubi sububi

1 Like