0 votes

I'm trying to animate my spaceship's 3rd person camera similar to this.
( https://www.youtube.com/watch?v=ijh-n-ntImA ) however the animations only play one at a time so it ends up looking very choppy. there are four animations for up, down, left and right which just move the camera a bit in those directions. I need to get the animations to blend with each other(for example up and left at the same time), and when when the ship stops turning have the camera smoothly slide back.

this is the code for the movement part.

extends RigidBody

var speed = 1
var isshooting = false
var laserCount = 0
var laser = preload("res://assests/models/laser/laser.scn")
var laserArray = []
var up = false
var down = false
var left = false
var right = false

func _ready():


func _fixed_process(delta):

if Input.is_action_pressed("ui_accelerat"):
    speed = speed + .1

if Input.is_action_pressed("ui_decelerate"):
    speed = speed - .1

if Input.is_action_pressed("ui_up"):
    if up == false:
        up = true
    up = false
if Input.is_action_pressed("ui_down"):
    if down == false:
        down = true
    down = false
if Input.is_action_pressed("ui_left"):
    if left == false:
        left = true
    left = false
if Input.is_action_pressed("ui_right"):
    if right == false:
        right = true
    right = false

if speed > 10:
    speed = 10
in Engine by (81 points)

I guess you need AnimationTreePlayer.
This might help.

3 Answers

0 votes

Well after days of frustration, I've solved by problem with coding. However I can say that yes you can play multiple animations at once with animationtreeplayer, it was wasn't what I was looking for. animationtreeplayer is very helpful if you want to switch from animation to animation very nicely. but not play four animations at once the way I wanted. if you want to how I did it with code go here.


by (81 points)
0 votes

Did you try using the tween class?

I use it for all things camera wise and it it works like a charm.

by (196 points)
+2 votes

I have just used a second animation player in the tree to solve this (2D) :)

by (26 points)
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 Frequently asked questions and 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.