Particle System Prefab on collision?
Ok so I am VERY new to unity and am trying to initiate a short particle system animation when my player (which is a ball) collides with a gameobject cube. I honestly have no idea where to start so it would be much appreciated if someone could help me out in really dumbed down terms. So heres what I have for my player.
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag ("Pick Up"))
{
other.gameObject.SetActive (false);
}
}
}
And heres the object I want to emit the animation. ( I also have more that I want to do the same thing if that helps)
using UnityEngine;
using System.Collections;
public class Rotator : MonoBehaviour {
void Update ()
{
transform.Rotate (new Vector3 (15, 30, 45) * Time.deltaTime);
}
}
So if someone could please help out this hopeless beginner I would really appreciate it.
Your answer
Follow this Question
Related Questions
changing the radius of a particle system with unity script 1 Answer
While particle system is alive play animation. 0 Answers
Can I shoot a ray from a particle that hit a collider? 1 Answer
Texture Sheet Animation broken in 2020.3.7f1? 0 Answers
Setting the Mesh of a particle system during runtime 0 Answers