Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Move : MonoBehaviour
- {
- private float player_move_speed;
- public GameObject player;
- // Start is called before the first frame update
- void Start()
- {
- player.transform.position = new Vector3(-228.3f, 6f, -212.6f);
- }
- // Update is called once per frame
- void Update()
- {
- player_move_speed = 5.0f * Time.deltaTime;
- float x = Input.GetAxis("Horizontal") * player_move_speed;
- float z = Input.GetAxis("Vertical") * player_move_speed;
- player.transform.Translate(new Vector3(x, 0, z));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement