IProjectileFactoryCollisionReceiver
v1.1

The IProjectileFactoryCollisionReceiver interface can be used to ensure that collisions executed by non-physics based methods such as ProjectileRaycastHitDetector or InstantHitForward properly know they've been hit.
This interface has one method:
When ProjectileRaycastHitDetector or InstantHitForward have the optional sendCollisionEnterToCollider, then any object that was detected will have this method called if the interface is present.
Projectile Collision Message
The struct ProjectileCollisionMessage contains data about the collision which an be used similar to a normal collision.
You will need to write a custom handler that implements IProjectileFactoryCollisionReceiver, or add the interface to an existing class. Then you can choose what to do with it.
Example Implementation
In the Juicy Actions Integration for Projectile Factory, the cubes and spheres are basic objects without any fancy actor type class on them. Since each demo projectile has differnet collision behaviors, we want the sphere and cube to react properly.
In this class, which ships with the integration package, we call HandleTriggerEnter(null) when the OnProectileFactoryCollisionEnter event is received. This calls the OnEnter actions.
Note that to make this work the projectiles must have the option enabled to send this data, and the ActionOnCollision, ActionOnTrigger, or ActionOnPhysicsEvent components must allow null colliders.



With those set, our sphere and cube objects now have Juicy Actions when they're hit by any projectile.
Last updated