I’ve looked around and seen solutions to this problem, but for some reason I just can’t get it to work… Here’s the basic gist:
I have my controls for a third person type setup in my playercontroller class. Everything works just fine so far. I’ve created a system whereby holding down right mouse button instantiates “free look mode” (moving the mouse rotates the camera around the player character to look around) and holding down both left and right mouse buttons will instantiate “move mode” whereby dragging the mouse left and right will rotate the player as it continues to move forward with the camera lagging behind. All sweet. What I need now, and it has been killing me for about two days is to be able to transitionally reset the camera behind the player character with the press of a button (for clarity, the camera is on a spring arm in the playercharacter class).
I can get it to instantaneously snap into position with this simple setup:
But as soon as I try and add a RinterpTo type setup I’m running into dramas. The below:
Incrementally snaps in decreasing intervals towards the eventual destination rather than one single interpolating movement. In other words, if I rotate the camera a long way from behind my character and press the middle mouse button the camera will snap to a location a large percentage of the overall required travel distance instantaneously. Press the button a second time and it will travel less. Keep repeatedly pressing and by the time the camera is here it needs to be it is moving in fractions.
Edit to add: The Turn Rate Variable is 10. I’ve mucked about with this number, but it doesn’t seem to make much difference. Certainly doesn’t look like the cause of the issue.
All of this makes me think that I need some sort loop to check if the camera is where it needs to be, else keep going type setup (I don’t want to have to hold down the button to get there, single click and transition is the aim), but I haven’t been able to get that to work either. Help me Obi Wan Kenobi’s, you’re my only hope
The other question I have: Is there anyway to check on the status of the caps lock key? It seems odd that the only persistent state key we have can seemingly be only accessed as a key stroke. I’ve tried Is Input Key Down but that’s still a check on the physical state of the Caps Lock rather than whether it is on or off. For an example, if I want Caps Lock off = walk mode; Caps Lock on = Run mode, is there any way to do it?
Cheers in advance.