#character model is purely visual, "summon_character.mcfunction" creates our collision hull that actually does things

#why is our player made up of two different entities?
#well, it allows for more control over animation and the visual rotation of the character without making any sacrifices to the smoothness of it's true motion
#also allows us to do stuff like offsetting the model

execute unless entity @s[scores={lastDirection=2..8}] run summon minecraft:armor_stand ~ ~-1 ~ {Tags:["player_model","setme","has_arm"],Rotation:[0f],DisabledSlots:4144959,NoGravity:1b,Silent:1b,Invulnerable:1b,Invisible:1b,Glowing:0b,ArmorItems:[{},{},{},{id:"minecraft:yellow_dye",Count:1b,tag:{CustomModelData:1234567}}]}
execute if entity @s[scores={lastDirection=2}] run summon minecraft:armor_stand ~ ~-1 ~ {Tags:["player_model","setme","has_arm"],Rotation:[45f],DisabledSlots:4144959,NoGravity:1b,Silent:1b,Invulnerable:1b,Invisible:1b,Glowing:0b,ArmorItems:[{},{},{},{id:"minecraft:yellow_dye",Count:1b,tag:{CustomModelData:1234567}}]}
execute if entity @s[scores={lastDirection=3}] run summon minecraft:armor_stand ~ ~-1 ~ {Tags:["player_model","setme","has_arm"],Rotation:[90f],DisabledSlots:4144959,NoGravity:1b,Silent:1b,Invulnerable:1b,Invisible:1b,Glowing:0b,ArmorItems:[{},{},{},{id:"minecraft:yellow_dye",Count:1b,tag:{CustomModelData:1234567}}]}
execute if entity @s[scores={lastDirection=4}] run summon minecraft:armor_stand ~ ~-1 ~ {Tags:["player_model","setme","has_arm"],Rotation:[135f],DisabledSlots:4144959,NoGravity:1b,Silent:1b,Invulnerable:1b,Invisible:1b,Glowing:0b,ArmorItems:[{},{},{},{id:"minecraft:yellow_dye",Count:1b,tag:{CustomModelData:1234567}}]}
execute if entity @s[scores={lastDirection=5}] run summon minecraft:armor_stand ~ ~-1 ~ {Tags:["player_model","setme","has_arm"],Rotation:[180f],DisabledSlots:4144959,NoGravity:1b,Silent:1b,Invulnerable:1b,Invisible:1b,Glowing:0b,ArmorItems:[{},{},{},{id:"minecraft:yellow_dye",Count:1b,tag:{CustomModelData:1234567}}]}
execute if entity @s[scores={lastDirection=6}] run summon minecraft:armor_stand ~ ~-1 ~ {Tags:["player_model","setme","has_arm"],Rotation:[225f],DisabledSlots:4144959,NoGravity:1b,Silent:1b,Invulnerable:1b,Invisible:1b,Glowing:0b,ArmorItems:[{},{},{},{id:"minecraft:yellow_dye",Count:1b,tag:{CustomModelData:1234567}}]}
execute if entity @s[scores={lastDirection=7}] run summon minecraft:armor_stand ~ ~-1 ~ {Tags:["player_model","setme","has_arm"],Rotation:[270f],DisabledSlots:4144959,NoGravity:1b,Silent:1b,Invulnerable:1b,Invisible:1b,Glowing:0b,ArmorItems:[{},{},{},{id:"minecraft:yellow_dye",Count:1b,tag:{CustomModelData:1234567}}]}
execute if entity @s[scores={lastDirection=8}] run summon minecraft:armor_stand ~ ~-1 ~ {Tags:["player_model","setme","has_arm"],Rotation:[315f],DisabledSlots:4144959,NoGravity:1b,Silent:1b,Invulnerable:1b,Invisible:1b,Glowing:0b,ArmorItems:[{},{},{},{id:"minecraft:yellow_dye",Count:1b,tag:{CustomModelData:1234567}}]}

scoreboard players operation @e[tag=setme,limit=1] playerID = @s playerID
scoreboard players set @e[tag=setme,limit=1] lifespan 20
tag @e[tag=setme] remove setme