I’m making an enemy npc that will hit a wall and then move back in the direction it came from. When implimenting this i want the collision group for the enemies hitbox to change to the other side of the enemy.
So i produced the below code which should flip the collision group on the x axis when the velocity is less than 0 which is caused by the enemy hitting a wall:
function called can only access instances within the same collection.
"enemy:/enemy#enemy_hitbox" points to the hitbox of an enemy in a game world named “enemy” (which probably doesn’t exist). Assuming the script and the collision object are part of the same object, you can shorten that to "#enemy_hitbox".