Unity: Random Stuff

nananana·2022년 10월 27일
0
post-thumbnail

Working with a rolling ball with no direction what so ever.

First of all, I tried to keep the camera and player object synced together.

Immediate attempt was to make the Main Camera a child element of the player object. Which resulted in my camera rolling around with the ball.

So I searched for Unity tutorials and resorted to this script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraControl : MonoBehaviour
{

    public GameObject player;
    private Vector3 offset;
    // Start is called before the first frame update
    void Start()
    {
        offset = transform.position - player.transform.position;
    }

    // Update is called once per frame
    void LateUpdate()
    {
        transform.position = player.transform.position + offset;
    }
}

The GameObject player does not have to loaded in the script. It seems I can just drag it in as reference in the unity game engine. Cool!

Now I wanted a larger terrain to work with.

Through this tutorial video: Link ----- and as always thank you creators.


So now the ball has its playground. Unfortunately I found a bug where when the ball reach a high enough velocity it would just clip through the terrain.


I still have no idea what to do with this project. Was supposed to be a role the ball and eat pills kind of tutorial game. Lets see what happens later.

I still do have more ideas for other projects (non-games).
Docker based demo displaying functions of security protocols through the network would be interesting to make. But I might not do it like my inconsistent update to this place.

Back to some factorio and youtube binge watching.
Bye!

0개의 댓글