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 trialRanvir Sahota
9,844 PointsError: ParticleCollisionSystem obsoleteuse colliderComponent
Assets/Standard Assets/ParticleSystems/Scripts/WaterHoseParticles.cs(41,48): error CS0619: UnityEngine.ParticleCollisionEvent.collider' is obsolete:
collider property is deprecated. Use colliderComponent instead, which supports Collider and Collider2D components.'
2 Answers
Ranvir Sahota
9,844 PointsI found a fix and decided to post my solution just in case others find themselves in the same situation Comment out these lines (Line numbers should start around 42 and end at 48):
/*var col = m_CollisionEvents[i].collider;
var attachedRigidbody = col.GetComponent<Rigidbody>();
if (attachedRigidbody != null)
{
Vector3 vel = m_CollisionEvents[i].velocity;
attachedRigidbody.AddForce(vel*force, ForceMode.Impulse);
}*/
You'll find the script here: Components in Unity\Assets\Standard Assets\ParticleSystems\Scripts\WaterHoseParticles.cs If anyone knows the game object name this script is attached to please inform me. I have tried to find the game object the script is attached but have failed. I would like to resolve this issue and the current fix could cause poblems later on.
Greg Austin
10,890 PointsOr you could just do what the console says and change:
var col = m_CollisionEvents[i].collider;
to:
var col = m_CollisionEvents[i].colliderComponent;
I think that's all there is to it...I'll confirm when I get through the rest without any related errors