Skip to content

How to cast between Godot class types? #48

Closed Answered by Splizard
Ullanar asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! Yes you can do this with gd.As.

if body, ok := gd.As[gd.CharacterBody2D](a.Temporary, node); ok {
    body.SetVelocity(vec)
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Splizard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants