|
using System.Collections;
using System.Collections.Generic;
using UnityEngine.EventSystems;
using UnityEngine;
using Unity.VisualScripting;
using System;
public class Playcontrol : MonoBehaviour, IPointerClickHandler
{
public float forcenub;
Rigidbody rb;
public void OnPointerClick(PointerEventData eventData)
{
switch (eventData.button)
{
case PointerEventData.InputButton.Right:
Update();
{
float hInput = 0;
hInput = Input.GetAxis("Horizontal");
float vInput = 0;
vInput = Input.GetAxis("Vertical");
rb.AddForce(new Vector3(hInput, 0, vInput).normalized * forcenub);
}
break;
}
// Start is called before the first frame update
void Start()
{
rb = GetComponent();
}
// Update is called once per frame
}
private void Update()
{
throw new NotImplementedException();
}
} |
|