Particles in enemy

Particles in enemy seem to be born inside the capsule instead of on the cyinder’s surface.

Hi Jaimun,

I am a little confused on how you mean inside the capsule?
Our level is made with cylinders and cubes and the only capsule is the player i think.

If you could expand on this and provide some screenshots i can hopefully see what you mean and i can help you further on this.

I have tested in my project and all the particle effects for me appear on the outside of everything i shoot at.

Thanks in advance

The enemy is a capsule, with a capsule collider of the same size, when we add the shooting particle system.

Thanks, You had me confused with the cylinder surface where i think you meant capsules surface.
We update the enemies to drones later but even turning my enemy speed down to 1 (it was at 5) mine seem to have the particles instantiate on the capsule surface.

Can you post your shoot function so we can rule out an issue there please?
Also double check that your sparks scene is set at the transform 0,0,0

Sorry, my bad, yes, I meant the capsule surface.
The sparks are at 0,0,0
The Enemy and it’s mesh and collider too.
When enemy’s speed is 1 it seems to work fine.
Here you have a little captured video:

		var spark = sparks.instantiate()
		add_child(spark)
		spark.global_position = ray_cast_3d.get_collision_point()

Hi Jaimun,

This is expected behavior with the code we are using.
We are instantiating the sparks and adding it as a child to the scene and placing its global position at the point where it hits.
Whilst this is happening which takes a while the enemy is still moving so it appears as if it is instantiating inside the enemy.
This is shown by when we slow the enemy movement speed down then there is less distance moved before the sparks play and so we see them closer to the surface.

This becomes less of an issue when we have a less solid shape for the enemies later in the course.

A more complex solution would be to have it instantiate as a child of the enemy but i think having the sparks move with the enemy as it moves looks a little weird in comparison.

Oh, it makes perfect sense. I was just curious about it.

BTW, congratulations for these tutorials, they are the best I’ve ever followed. Everything works.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms