Now that Tim is back (welcome back, sounds like a hell of a few years!)
Several cameras with completely different orientations but the forward input is always preserved while it's held down, the other input (left/right) is updated as soon as the camera changes.
Thanks!
Hey @brokenbeargames ,
I hate to admit it, but I haven't played Resident Evil. So, the video was helpful.
If you can help me understand more, I might be able to point you in the right direction. Let's take these two images. The second one happens right after a view transition.
If the system is relative to the camera, in the first image I imagine I would press "S" to have the character run towards the camera. In the second image, I would imagine I would press "W" to have the character run away from the camera. From what you're saying, RE will keep the old camera view as the reference until no input is held. Then, it uses the new camera view as the reference.
I think that's what you're asking for.
To start (and you may be doing this), I wouldn't change the "Camera Rig" property on the Motion Controller. Instead, I'd have the "fixed camera views" set in the scene and then swap the Camera Rig's position and rotation to the new "fixed camera view" position and rotation when you're ready.
I would put the logic in a new component on the Input Source MonoBehavior. This way you can check the input source for any key presses using the MovementX and MovementY properties. If they are both 0, do the swap (if there is one). Otherwise, use the current "fixed camera view" to update the current position and rotation of the MC's Camera Rig each frame.
I think that's the best way to preserve the rotation and direction.
If you'd rather do it at the "input level", you would actually want to create your own custom movement motion. The Unity Input Source handles input, but doesn't really take the camera angle into account. That's done in the movement motion where the input + camera + environment is used to determine final movement. You can see in the UnityInputSource.cs that it doesn't actually reference the camera anywhere.
What movement motion are you currently using?
I'm using the BasicWalkRunPivot, I guess what I'm trying to explain quite complicated to communicate, I made some images to help:
Hmm my previous post with the details says "Awaiting moderation"?
@brokenbeargames Yeah I've been getting lots of spam. I need to research this forum tool to figure out how to let good people automatically post. Just another thing on my list... haha.
I believe I understand. BasicWalkRunPivot should be fine.
If you do what I posted above, you should be ok... even walking towards the camera.