"Activate" function changes socket location

mjfabian
Sat, 03 Jan 2015 01:50:36 +0000
FX

I am trying to make a vehicle that can shoot while moving, along with a muzzleflash particle effect. I was originally using Spawn Emitter at Location but the particles were not inheriting the velocity of the vehicle. I managed to get them to inherit the velocity by adding the muzzleflash effect to the component list of the vehicle blueprint (attached to a socket), and then activating it using a retriggerable delay while mouse button 1 is pressed.

This works fine for the first shot but every subsequent bullet that spawns while mouse1 is held down is about 100 cm too high. If I print the socket location you can see it jump up by about 100 units. The particle effects spawn in the correct place–only the bullet itself is wrong. If I attach a sphere to the socket and make it visible in-game I don’t see it jumping at all. If I rapidly click mouse1, there is no issue. This problem only happens while holding down mouse1. Getting rid of the Activate node fixes the bullets (but the particle effect obviously does not play).

I have tried using Spawn Emitter Attached but it doesn’t seem to allow the particles to inherit velocity (or I haven’t figured out how). When using Spawn Emitter Attached, both the bullet and the muzzleflash particle effect spawn too high after the first shot, and the problem only starts until after I press a button associated with vehicle movement.

2 posts - 1 participant