Answer the question
In order to leave comments, you need to log in
I'm making a game about pop it. It is necessary to make a script so that the pimples can be popped on both sides of the wheelbarrow. How can you do?
I'm new and don't know how to do it. Made the code to work on 1 side. I think whether it is possible through the animator or not?
here is the code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class ControllerPressing : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public Animation anim;
public MeshCollider colliderdestroyed;
public void Awake()
{
anim = GetComponent<Animation>();
}
public void OnPointerDown(PointerEventData eventData)
{
}
public void OnPointerUp(PointerEventData eventData)
{
anim.Play();
MeshCollider.Destroy(colliderdestroyed);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question