#I m looking at the tutorial and the code

1 messages · Page 1 of 1 (latest)

pallid forge
#

this is mine

#
  1. I want the code to change the hp value(Which works successfully
#
  1. everything starts falling apart when you get to the particle system.
median sierra
#

Just move your destroy to the end, then

#

So that the code all runs before destroying

dusty yarrow
#

Destroy happens at the end of the frame so that shouldn't matter

pallid forge
#

It still wont play the particle effect

#

I tried swapping out the particle effects

dusty yarrow
#

Have you assigned the particle system in the inspector?

pallid forge
dusty yarrow
#

Also is the particle system a child of this object?

dusty yarrow
pallid forge
#

the health gain effect isnt a child of the health collectable

#

Im also noticing an issue with hurt effect as well

dusty yarrow
#

If HealthEffect is a child of Ruby, I think RubyController should do the particle effect playing

pallid forge
#

currently hurteffect is working as it should be but the moment i swap it out the particles dont show up

dusty yarrow
#

Instead of this other script

pallid forge
#

okay

dusty yarrow
#

Move the whole healthGain variable into RubyController

pallid forge
#

I did it and it started working

#

thank you

#

but for learning purposes is it not working because the health gain effect wasn't a child of the pickup

dusty yarrow
#

I guess the healthGain variable wasn't set correctly in HealthCollectible's inspector

#

Not sure, you didn't show it

pallid forge
#

It wasn't

dusty yarrow
#

But if it's a part of Ruby, then RubyController should have the reference to it

pallid forge
#

okay