We have this in a few projects. Many ways to do it, but here’s what we did:
- PlayerController has multiple “player states” it can be in, like Walking, Paused, or Inspecting, all deterministic (one at a time)
- Inspecting is a player state
- During Inspecting state, player movement is stopped, and the inspected object zooms to a named socket location on the player character
- The named sockets to zoom to are on a mesh attached to the player’s current character, which is centered at the character’s camera
- the inspected object simultaneously lerps toward the socket in front of the camera, and shrinks to a designated amount (there is no choice but to set this shrink value up per-object)
- By some key or button press, the player exits Inspection mode, and the inspected object lerps back to its original location
- we limited “Inspected objects” to actors only, components are doable as well, but will require different handling
Uhh yeah that’s a lot and it takes some thought to implement, and details will certainly vary according to your game framework. Especially the UI stuff.