i got issue in on screen joystick unity c#
0
down vote
favorite
i m getting issue in joystick. when i click on joystick anywhere in joystick area its by default click at bottom then work fine. also here i made video for this issue please check & given below my c# code.
Please help me
private Image bgImage;
private Image joystickImage;
public Vector3 InputDirection { set; get; }
private void Start()
{
bgImage = GetComponent<
joystickImage = transform.
InputDirection = Vector3.zero;
}
public virtual void OnDrag(
{
Vector2 pos = Vector2.zero;
if (RectTransformU
{
pos.x = (pos.x / bgImage.
pos.y = (pos.y / bgImage.
float x = (bgImage.
float y = (bgImage.
}
}
public virtual void OnPointerDown(
{
OnDrag(Ped);
}
public virtual void OnPointerUp(
{
InputDirection = Vector3.zero;
joystickIm
}
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Unity Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: