I’m having a hell of a time, so I’m hoping someone can help me out.
I’m trying to implement semi-tank controls with a third person camera. If anyone played Asheron’s Call, it’s sort of like that.
So W/S for forward and back, A/D for turn left and right (Character relative), and the user able to free-rotate the camera (holding down a modifier key, like RMB). If they rotate the camera, the camera would remain character-relative (as in if you look behind the player, the camera looks behind the player from then on no matter what) I’ve posted what I have so far (May need to open image in new tab, I think imagur is compressing it.
My character moves forward and back and turns left and right just fine so long as I’m not using the camera rotation key. I can also rotate the camera fine so long as the character is standing still. If I move the character forward and back while rotating the camera, that works (the movement is meant to be character-relative, so you can look behind the character while pressing W to run forward, for example).
I have a couple problems:
- If I hold down RMB and rotate while moving, the camera orbits rather than turning the character (I think this has to do with setting the controller rotation yaw to false, but I’m not sure how else to do this).
- If I rotate the camera around and release, the character snaps to face the camera, rather than the camera just sitting put
I feel like the solution to 1) is not using Add Controller Pitch Input for movement, but I have no idea how to do it otherwise. I tried actor rotation but then I can’t move and turn (I end up with something more like pure tank controls ie: resident evil).
Can anyone suggest anything that would help? I’m planning to finally implement a strafe key as well, but I feel I need to fix these fundamental issues in order for Strafe to work properly.