0
\$\begingroup\$

This is a problem that seems to have no reasonable answer anywhere around, yet is a commonly needed aspect of developing game mechanics.


Context

I'm developing a traditional 3rd person character controller esque thing, you know, camera controlled by mouse/joystick all that jazz.

The issue comes when I'm developing a climbing system:

  • I have to develop a climbing system, and when I 'attach' the player to a climbing ledge, they could be at any angle relative to this ledge, up to perpendicular.

  • When the player jumps up, and the ledge detection runs, the player attaches to the ledge, and needs to rotate to be facing the ledge dead on.

  • I need a method for the camera movement to be completely independent of this capsule collider rotation change, as currently I have this problem:...


Problem

When I rotate my player's capsule collider, the attached camera boom rotates with it.


Specific Problem

When I set my actor's rotation directly, the camera orients itself immediately with the player's direction, then immediately returns itself to the previous view, creating a massive camera jitter, especially at lower framerates.


The question

How do I prevent this behaviour

OR

How do I reapproach problems of rotating the player character?

\$\endgroup\$
  • \$\begingroup\$ I don’t get why the camera returns back to the previous direction ? \$\endgroup\$ – ColdSteel Feb 4 at 18:07
  • \$\begingroup\$ If I understand correctly you dont want the camera to rotate with the pawns capsule - then you can mark camera component (what ever is holding it actually) rotation to world space (as opposed to relative). \$\endgroup\$ – ColdSteel Feb 4 at 18:12
  • \$\begingroup\$ @ColdSteel Yeah I don't get it either. Hm, I'll try setting the camera component to world space just before I set the player rotation, and then set it back afterwards. If that doesn't work, I'll try posting a few videos of what happens \$\endgroup\$ – Natalo77 Feb 5 at 9:18
  • \$\begingroup\$ why would you set it back ? If you want the camera not rotating with the player, then use the camera in worldspace :-? \$\endgroup\$ – ColdSteel Feb 5 at 9:50
  • \$\begingroup\$ @ColdSteel Ah. I need to provide a little more context, see the post edit above \$\endgroup\$ – Natalo77 Feb 5 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.