Hey there,
I’m new to replication in general so I’m probably doing something wrong.
I have a material set up with a “smear” effect to give it a sort of comet tail look:
I’ve got a Vector Parameter called “Direction” that can be used to change the direction of the tail. This material is applied to a mesh in my projectile and the Direction is driven by EventTick and set to be controlled by the reverse forward vector of the Projectile Collision:
I thought this would just execute locally and I wouldn’t have to replicate anything, but I was wrong. For the clients, the projectiles are sideways sometimes. So I’ve been trying to figure out how to replicate the value with no luck. I’ve tried running on client, server with multicast, a combination of server and multicast. I’ve also tried making the MID itself replicated. Nothing works. The projectile is set to replicate and replicate movement. I’m totally stumped.
Help, please!
Afaik, cosmetic stuff shouldn’t be replicated and should run on the client only.
Can you show a video of the issue? Is it constantly inverted or does it change direction sometimes? (This could be caused by a desynchronization between server and client but it shouldn’t happen)
Also, have you considered using an emitter for the trail?
Yeah, I thought so too, but it doesn’t work if I run it on client.
I could use an emitter for the trail, I just liked the mesh effect more, but you’re probably right I would imagine that the emitter won’t have the issue and is probably more efficient. I’d still like to know why it’s not working though.
What happens is that the trail is coded in the material to work along X so as long as the enemies are shooting at you along that axis it works, but as soon as they shoot at you along the Y, the projectile is coming at you sideways. lol
Okay, weirder and weirder. I made a particle mesh and it’s got the same issue. So obviously I can’t use a mesh or it will always get the rotation wrong. I thought a particle would update it’s rotation to move in the direction of the projectile though, but I guess not?
You need to use a Ribbon renderer if you want to avoid that issue, using a mesh particle is the same as using a mesh with a material, by the way I would try to understand the real issue (even if the ribbon renderer would work)
I mean, I’d love to but I don’t really have the extra time right now. I’d rather focus on actual problems
I was just hoping someone else had experienced it before and could provide some insight.
Thanks for the ribbon emitter idea. I’ll look into it later, but for now I’m just gonna switch the projectiles to spheres.
So I found a solution that doesn’t require replication.
My first issue was that the tail effect in the material was set to be world space so it didn’t matter what direction I rotated the mesh, the tail would always be facing down X. So I made a new material and mesh so that it’s length is running down the X axis. Then inside the Projectile Movement I found a checkbox for Rotation Follows Velocity. Turning this on makes the projectile always rotate towards the velocity of its movement so the mesh faces the correct orientation.
It’s not a solve for replicating a MID parameter, but it’s a good enough workaround to have non-spherical meshes in your projectiles.
As for the MID, I’m guessing it needs to be set on RepNotify so everyone gets the update, but I still haven’t been able to get it working.