0 like 0 dislike
I'm implementing a render target painting solution for rain (to visualize where rain drops are actually falling.) I have pulled the info upon collision, or at least I thought I did.

Right now I have an event listener for the OnCollide event. However, when I pull the Position particle field it seems to give me the position of the emitter itself, or a smaller scale offset from that point for each collision.

I need to know the -exact- location in world space where each sprite hits in order to then find the collision UVs in UE4 and paint to the render target texture.

As of right now I am shooting a line trace from far above the collision to far below, to make sure it's reading the ground. (The trace fires off properly, but it seems to give me a small scale area based on the emitter's world location when it should cover the entire ground.)

UPDATE: While grabbing the location of the collision via particle field in blueprint, I have now tried to scale the transform of the emitter before converting into world space. This seems to be a step in the right direction, but as you can see the location is not completely accurate as it is offset from the center of the emitter. Definitely better, but I want to understand how to fix this completely.
by denominator90 (180 points)
I've made a little head-way with this. While converting the local position of the collision into world space, I've scaled the emitters transform. This has scaled this "square" shape, but it seems to be offset from the center of the emitter now.

1 Answer

0 like 0 dislike
I actually solved this just now with a coworker.

While converting the local space into world space, scaling the transform by 100 fixed the size. (I originally thought this was due to the units being different between popcornFX and UE4 (ue4 being cm and fx being meters). Changing the units did not help, BUT scaling by 100 in UE4 via blueprint helped.)

To fix the offset all I did was take the transform location of the parent object and multiplied it by 0, then plugged that into the "Transform Location" node (to convert local to world). This replaced the positions to the center, but at the correct scale.

Working as needed for now! (except for when I rotate the emitter to get angled rain, but I might just do that in the effect instead!)
by denominator90 (180 points)