0 votes

I am trying to implement twin stick controls in my 3rd person RPG game. The look and feel I am aiming for is similar to Ocotpath Traveler (2D sprites in a 3D world).

enter image description here

Right now my player character is structured like this:

KinematicBody
 -CollisionShape
 -Sprite3D
 -AnimationPlayer
 -Spatial
 --Camera
 -Spatial(attackRotation)
 --Sprite3D(AimIndicator)

And my code looks like this:

if Input.is_action_pressed("rotate_left"):
    attackRotation.rotate_y(deg2rad(3.5))

if Input.is_action_pressed("rotate_right"):
    attackRotation.rotate_y(deg2rad(-3.5))

But right now, it just rotates the indicator clockwise/counterclockwise when I tilt my right analog stick to the right/left. What I am trying to do is a more direct control. For example: When the player tilts the stick to the top-left, I want the indicator jump to the top-left of the character model.

How would you implement these kind of controls?

in Engine by (21 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.