Hello, I am fairly new to Unity and an amateur (I’m more of a designer than a programmer).
I am doing University work and I’m trying to make my character cause an explosion, and when the player sets off the explosion particles emitter, I want the particles to knock the player backwards (obviously this would mean getting direction of the particle and move the player accordingly rather than a set movement), how would I go about doing this? I have a method of getting the direction (I think):
function OnParticleCollision (go_Part_System : GameObject)
{
if(st_PC_State == "Alive")
{
if(go_Part_System.gameObject.tag == "Explosion")
{
var direction: Vector3 = go_Part_System.transform.position - transform.position;
direction = direction.normalized;
So how would I go about pushing the player back in the direction of particle collision?
Any assistance would be GREATLY appreciated.