this is a script i copied from a tutorial, for some reason it doesnt work the way in the tutorial.

This script is supposed to move a 2 object to the left, which it does but it does it too quick in the tutorial the guy said that * Time.deltaTime would fix it which it didn't for me please help im confused?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PipeMovingScript : MonoBehaviour
{

public float MoveSpeed = 5;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
transform.position = transform.position + (Vector3.left * MoveSpeed) * Time.deltaTime;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PipeMovingScript : MonoBehaviour
{

public float MoveSpeed = 5;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
transform.position = transform.position + (Vector3.left * MoveSpeed) * Time.deltaTime;
}
}
9 Replies
Buddy
Buddy2d ago
Please do not blindly copy
MENN | Kaiju
MENN | KaijuOP2d ago
i dont i searched up waht delta timne meant thats how ur supposed to learn right
Buddy
Buddy2d ago
Good. as for the movement speed, via the editor you can change MoveSpeed
MENN | Kaiju
MENN | KaijuOP2d ago
what
Buddy
Buddy2d ago
in the unity inspector, you can change the movement speed. Make sure you have not changed it
MENN | Kaiju
MENN | KaijuOP2d ago
okay ill look
MENN | Kaiju
MENN | KaijuOP2d ago
No description
MENN | Kaiju
MENN | KaijuOP2d ago
the only move speed there is is the variable i made
MENN | Kaiju
MENN | KaijuOP2d ago
whenever it starts it goes super quick
No description

Did you find this page helpful?