I have two parent nodes, each with a collision shape and a sprite. One is a StaticBody2d, the other is a KinematicBody2d.
My player (KinematicBody2d) uses move_and_slide to collide and has a capsule shaped collision. The bush (StaticBody2d) also has a capsule shaped collision.
When I move my player into the bush from the side, the player automatically snaps to the left or right of the bush, flush with the bush's x axis. When I move my player to collide with the bush from the bottom or top, it does not snap to the y axis or x axis. The player does not slide along the bush's collision whatsoever either.
I've only been using godot a couple days, sorry if it's an obvious fix! Any help or insight I'd really appreciate though.
Player's script:
extends KinematicBody2D
var velocity = Vector2.ZERO
const ACCELERATION = 15
const FRICTION = 20
const MAX_SPD = 60
func physicsprocess(delta):
var input_vector = Vector2.ZERO
input_vector.x = (Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left"))
input_vector.y = (Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up"))
input_vector = input_vector.normalized() * MAX_SPD
velocity = velocity.move_toward(input_vector, ACCELERATION if input_vector != Vector2.ZERO else FRICTION)
velocity = move_and_slide(velocity)