Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAlex Ly
909 PointsParticles not appearing when in contact with the bird
I did everything correctly and there are no errors but when I play and the bird touches me there are no particles.
3 Answers
christopher allen
6,495 Pointsi had the same problem but realized the "o" in OnTriggerEnter
needs to be capitalized for it to work, i hope this helps!
David Kirk
5,319 PointsI had the same happen when I added particles to fly at first go. Make sure the PlayerParticles prefab is in the Player Health script "pickup Prefab" field. And ensure you have selected Apply on the inspector to save the player object.
Alex Ly
909 PointsSorry for the late reply, I did exactly that and it still doesn't show the particles. I also don't die when i get in contact with the bird
David Kirk
5,319 PointsOk the playerhealth script that object needs to be attached to your player object script, and the "alive" checkbox should be unchecked. and the PlayerParticles script inside of the Pickup Prefab Serialized field. i think the part of the script that detects player alive = false is in that script. this is what i have there hopefully the answer is close.
public bool alive;
[SerializeField]
private GameObject pickupPrefab;
// Use this for initialization
void Start () {alive = true;}
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Enemy") && alive == true)
{
alive = false;
// create the pickup particles
Instantiate(pickupPrefab, transform.position, Quaternion.identity);
}
}
Alex Ly
909 PointsAlex Ly
909 PointsI didn't notice that.. Thank you so much!
christopher allen
6,495 Pointschristopher allen
6,495 PointsNo problem !