Differnt ways to move in unity3d part1 (Simplw ways) | Take input in unity
Channel:
Subscribers:
1,030
Published on ● Video Link: https://www.youtube.com/watch?v=PtyFJbKTkTk
Code :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ObjectMover : MonoBehaviour
{
public Vector3 speed;
public Transform target;
public float stepSpeed;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float verticalInput = Input.GetAxis("Vertical");
transform.Translate(verticalInput*speed.x*Time.deltaTime, verticalInput * speed.y*Time.deltaTime, verticalInput * speed.z*Time.deltaTime);
transform.position += speed * Time.deltaTime*verticalInput;
}
}
Other Videos By Muhammad Shahzaib
Tags:
unity
unity3d
move in unity
movement in unity
ways to move in unity
different ways to move in unity
learn unity
unity easy
unity tutorials
input system in unity
unity input system
take input in unity