Reusing actions on actors of unknown type? #269
Unanswered
Shadowblitz16
asked this question in
Q&A
Replies: 3 comments
|
Yeah I miss having this but I dont think is possible due to the nature of gdscript. It works with duck typing and its very useful for prototyping. For this to be possible we would need gdscript to have generics and interfaces (or traits). PS: Now I see you where the one that opened the generics proposal lmao |
0 replies
|
I personally just do this at the start of var _actor : Actor = actor as ActorIt's not the most elegant solution and will crash if |
0 replies
|
Could this be a planned feature for #285? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Take a script like this for example...
How do we know actor contains a variable
positionof typeVector2?How do we ensure the action is not attached to something it can't work on?
All reactions