sinbad / SPUD

Steve's Persistent Unreal Data library
MIT License
300 stars 44 forks source link

Character Offset on Load with VR Character #67

Closed Project-Exhale closed 5 months ago

Project-Exhale commented 5 months ago

Hi Steve, Thanks for the Plugin. I just started implementing it into a Project based on the VR Expansion Plugin (https://github.com/mordentral/VRExpansionPlugin). Adding the interface to the VRCharacter (which I think uses a custom VRMovementComponent) results in a positional offset of ~1m to the right after loading compared to the position on save (also resulting in falling down after saving on an edge). I wondered if you know any possible reasons before I start to dig into it myself?

sinbad commented 5 months ago

Sorry, I can't think of anything off hand. SPUD just teleports the character back to its previously reported location and resets velocity on standard movement controllers, but won't know about any custom ones, perhaps that's the place to start looking.

Project-Exhale commented 5 months ago

Is there a way to quickly retrieve the saved data from a save? E.g. to print the saved transforms when clicking "save game"?

sinbad commented 5 months ago

You can debug USpudState::WriteCoreActorData and USpudState::RestoreCoreActorData or add some UE_LOG entries to them.

Project-Exhale commented 5 months ago

grafik

So it seems like the transform is restored correctly but changes only a Frame after Restore for unknown reasons. Disabling the Velocity restore (only time the MovementComponent is needed?) doesnt change the behavior either.

Project-Exhale commented 5 months ago

I asked the VRE Developer and this might be a general VR Problem as the Position of the VR HMD/Camera is Offset from the Actor itself. Setting the Position manually on the Restore Custom Data Event works.

sinbad commented 5 months ago

There are quite a lot of things that can take a frame to sync up after major changes, I'd recommend keeping your loading screen up for a second or so more than should be strictly necessary to hide them. Also applies to hiding things like texture streaming as well.

I'll mark this closed then?