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 CharacterController : MonoBehaviour {
- public Transform myTransform;
- public GameObject gameObject;
- // Use this for initialization
- void Start()
- {
- myTransform = GetComponent<Transform>();
- }
- // Update is called once per frame
- void Update () {
- if (Input.GetKey(KeyCode.Mouse1))
- {
- Vector3 zielPosition = Input.mousePosition;
- Vector3 personPosition = myTransform.position;
- var Geschwindigkeit = 0.2f;
- var Richtung = zielPosition-personPosition;
- Richtung.y = 10;
- myTransform.position += Richtung * Geschwindigkeit
- * Time.deltaTime;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement