Reusing actions on actors of unknown type? #269
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 |
Beta Was this translation helpful? Give feedback.
-
I personally just do this at the start of var _actor : Actor = actor as Actor It's not the most elegant solution and will crash if |
Beta Was this translation helpful? Give feedback.
-
Could this be a planned feature for #285? |
Beta Was this translation helpful? Give feedback.
-
Take a script like this for example...
How do we know actor contains a variable
position
of typeVector2
?How do we ensure the action is not attached to something it can't work on?
Beta Was this translation helpful? Give feedback.
All reactions