Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class CharacterController : MonoBehaviour {
  6.  
  7. public Transform myTransform;
  8. public GameObject gameObject;
  9. // Use this for initialization
  10. void Start()
  11. {
  12. myTransform = GetComponent<Transform>();
  13.  
  14. }
  15.  
  16.  
  17. // Update is called once per frame
  18. void Update () {
  19. if (Input.GetKey(KeyCode.Mouse1))
  20. {
  21. Vector3 zielPosition = Input.mousePosition;
  22. var Geschwindigkeit = 0.2f;
  23. var Richtung = zielPosition;
  24. Richtung.y = 10;
  25.  
  26. myTransform.position += Richtung * Geschwindigkeit
  27. * Time.deltaTime;
  28.  
  29. }
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement