Hi! i’m doing a character creator interface and i’m doing the first scripts
i have this frame to select races that moves between each option (For now it moves freely on the screen)
with this script:
using UnityEngine;
using System.Collections;
public class Taptomove : MonoBehaviour
{
public float speed = 1.5f;
private Vector3 target;
void Start()
{
target = transform.position;
}
void Update()
{
if (Input.GetMouseButtonDown(0))
{
target = Camera.main.ScreenToWorldPoint(Input.mousePosition);
target.z = transform.position.z;
}
transform.position = Vector3.MoveTowards(transform.position, target, speed * Time.deltaTime);
}
}
I want it to just move on top of each button. How could I do? With triggers?
Could someone illustrate me?
thx
