How do I spawn particle emitter at specific Z-axis?
Hello all, decided to get back into UE4 and am having trouble spawning an emitter once the player enters water.
As the title says, I'd like to spawn a particle system for splashing. It works when I move, and it stops when the body of water is too deep. However, it always spawns at a fixed Z-value (I.e, 10 units or so above the player - at all times).
I'd like it to spawn at 'water' level, I've looked into other threads, and an image I found here:
Has what I want, but, I'm using 4.18 and am assuming this method has been deprecated. Attached is my current particle Blueprint system:
For reference, this Splash Blueprint is being referenced from the water plane Blueprint itself (It has the spawn actor reference while the splash blueprint itself has spawn emitter - Perhaps I have them mixed around?).
Does anyone have a suggestion on making the spawn emitter transform Z-location spawn only at water level?
asked Nov 15 '17 at 06:45 AM in Blueprint Scripting
You can do a line trace for object, set colision for water, set start at player location + capsule component half height (it shuld be his head) and end at player location - capsule comp. half height (should be the feet of character) make a branch if it hitted something and then another brach from initial overlap from breaked hit reault so that it doesnt spawn if your head is under water. If the initial overlap doeant seem to work if u are under water check trace complex, it shoild work without ir but I'm not sure) and if overlap is flase spawn particle emmiter at the hit location. I dont know how your water effect looks like and how you want it to look like, but if u want to update its(particle) location you can do a line trace again and update its location every tick, but it will be expensive for cpu so you can just save the line trace z value into variable and then every tick check if player location z + caps half height is smaller than saved z value so that the particle doesn't spawn/update if you are under water. If the z location is lower you can delete particle and just stop doing anything else and if its not lees than variable you should check if player lozation z - capsule half height is grater then saved z(so that the particle doesnt update if the fest of player are above water), if its grater go back to destroy particle and if its not greater you should get player location, break it and plug x and y to set actor location(of your particle)and get the z from your variable after this do a delay with 0s and plug it back to the first branch unless u plugged it into tick and mase variavle to enable or disable checking it or you made it as a function and made set timer for function(or something like that cuz I dont remember its name) and then just started and stopped it by handle.
Follow this question
Once you sign in you will be able to subscribe for any updates here