So i am working on a game where i want the character to automatically run in right and when he collides with an enemy to do something, and i just cant seem to fix the collision thing.
the code:
extends KinematicBody2D
var velocity = Vector2(150,0)
var speed = 1555
func ready():
print(speed)
func _physicsprocess(delta):
var collide = moveandcollide(velocity* delta)
if collide:
print(speed)
i tried this but nothing gets printed, the player character is a kinematicbody2d and the enemy is also a kinematicbody2d, i tried with a staticbody2d too and isnt working.Thats the only script i have and its attached to the kinematicbody2d, im new into coding so i would be gratefull if anyone could help me and explain this to me