Satisfactory ModdingSM
Satisfactory Modding15mo ago
24 replies
Beef

Moving Meshes at Runtime

Moving this here as it's still a blocker for me and I guess it's more complicated as the more general UE modding server suggested coming back here to ask again - Do you have to change anything else meshes to update? E.g. setting visibility off and on again, or disabling/re-enabling collision?

When updating node location, such as using
ResourceNode->SetActorLocation(NodeData.Location);
ResourceNode->SetActorRotation(NodeData.Rotation);
MeshComponent->SetWorldLocation(NodeData.Location);
MeshComponent->SetWorldRotation(NodeData.Rotation);

I notice that setting this location/rotation for both works if its during their spawn, but it doesn't appear to update their location once they've already been spawned.

I'm also not entirely sure if I have to update the MeshComponent separately from the Actor or not, since the mesh is attached to the actor when I spawn them using
ResourceNode->SetRootComponent(MeshComponent);
MeshComponent->RegisterComponent();


tried again with
ResourceNode->SetActorLocation(NodeData.Location, false, nullptr, ETeleportType::TeleportPhysics);
ResourceNode->SetActorRotation(NodeData.Rotation, ETeleportType::TeleportPhysics);
MeshComponent->SetWorldLocation(NodeData.Location, false, nullptr, ETeleportType::TeleportPhysics);
MeshComponent->SetWorldRotation(NodeData.Rotation, false, nullptr, ETeleportType::TeleportPhysics);

the method is being called and is updating these appropriately, and the mesh is moveable (also as an aside, weird how AActor::SetActorRotation is missing the fields the other methods have ... (https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/AActor/SetActorRotation/1)

I can't find anything in UE documentation or forum/reddit/etc that seems to deal with this
Epic Games Developer
Set the Actor's rotation instantly to the specified rotation.
Solution
It turns out I'm a big dumb and there were at least a couple issues
1. My identifier from spawning wasn't propogating back to the struct I store it in so he was not properly finding the resource nodes to begin with :sadalpaca: .
2. I wasn't ensuring that I ignored self-raycasts, so when it did work everything was wonky, especially since there was a small chance it was moving a node from elsewhere on the map on top 😅
Was this page helpful?