Hi everyone, I’m working on a Verse script in UEFN and I’ve run into an issue with VFX visibility.
The Setup: I have a Niagara System attached to a player (or a prop relative to the player).
The Problem: When I call FortChar.Hide() to make the character invisible, the Niagara effect disappears as well. It seems that .Hide() disables the rendering of all child components and attached effects.
My Goal: I want to make the player invisible to others and my self, but keep the Niagara VFX visible at the player’s location.
Questions:
Is there a way to hide the player without affecting the Niagara component?
Is there a specific Verse function to toggle player visibility only or should I be using a different approach?
I’d like to see how you are attaching the prop to the player. But I think you can solve the problem by making the prop follow the player instead of attach it to them.
To do it you can use a code similar to this one I’ve been using:
# Continuously moves the ball to follow the player
FollowPlayer(Agent:agent)<suspends>:void=
if(FortChar := Agent.GetFortCharacter[]):
loop:
# Stop following if the ball is no longer attached
if(IsAttached = false):
break
Sleep(0.0)
# Match the ball position and rotation to the player
PlayerPos := FortChar.GetTransform().Translation
PlayerRot := FortChar.GetTransform().Rotation
BeachBall.MoveTo(PlayerPos, PlayerRot, 0.1)
Then, if you attach the Niagara particules to the prop, it should still being active even if the player is hidden, as this prop will be following the player and not attached to it.