Hello i’m new to unity and i have been having problems with creating vertical movement for my submarine.
I have been looking all over the internet for an anwser but i can’t seem to find one. Does anybody know how to solve this problem? Than please help me here
The one that gives a good anwser will get a cs:go basilisk skin.
Transform.position.y += speed × time.deltaTime
Where’s my skin? ![]()
1 Like
In addition to that, you will want to decide if gravity should affect the submarine. You may also want to dynamically adjust the speed of movements, so the submarine moves very slowly initially. That way, it feels heavy and slow like a real craft would.
It did not worked for me
.
I needed to change it to transform.position = new Vector3(transform.position.x,transform.position.y+(speed*Time.deltaTime),transform.position.z)
1 Like
That/s because in his example speed was a Vector3.
void Update () {
transform.position+= speed* Time.deltaTime * Vector3.up; ;
}