I am also making a top down shooter (very early prototype still) and knew that I needed to get my movement out of the individual player/enemy scripts, just a little work and I was able to get my movement system in components using this method. Thank you for the quick guide it was extremely helpful and straightforward!
Selfishly, I am gonna start working on enemy AI and context based steering for my game soon, just in case you needed ideas for the next one 😅
Hey, thanks for the comment. The screenshot shows character_movement_stats.tres but that is a mistake, just use player_movemement_stats.tres instead (what it is named doesn't actually matter, it could be named anything, and it would still work).
I am also making a top down shooter (very early prototype still) and knew that I needed to get my movement out of the individual player/enemy scripts, just a little work and I was able to get my movement system in components using this method. Thank you for the quick guide it was extremely helpful and straightforward!
Selfishly, I am gonna start working on enemy AI and context based steering for my game soon, just in case you needed ideas for the next one 😅
thank you. While not a complete newb, I was just a tad bit coRnfused.
thanks for taking the time to answer.
You're welcome! Sorry for the discrepancy in the names.
"Once the scene is set up, don’t forget to set the export variables on the components"
Since your components are children of the nodes they act on, why not do:
`@onready var actor = $".."`
instead of
`@export var actor: CharacterBody2D`
?
It's just one fewer thing you have (and might forget) to plug in, right?
could you please point out where the "character_movement_stats.tres" is made ?
your article says "Once the scene is set up, don’t forget to set the export variables on the components"
but shows "character_movement_stats.tres" NOT "player_movement_stats.tres"
thank you
Hey, thanks for the comment. The screenshot shows character_movement_stats.tres but that is a mistake, just use player_movemement_stats.tres instead (what it is named doesn't actually matter, it could be named anything, and it would still work).
Thanks Ben, saved for later!