Been trying to fix these two lined of code for around 2 days now got it to the point where i just get one error message when i actually run it but became stumped can anyone help me?
The lines are if collider == $"../Paw" or collider ==$"../Borders": speed+=accel dir = dir.bounce(collision.get_normal())
On the last line after run i get a “attempt to call function ‘get_normal’ in base ‘null instance’ on a null instance” i searched it up and saw others with simular problems and usually its because of undefined nodes but i dragged and dropped straight from the ui also their both children nodes from my game node if that changes anything
So, you are calling normal on collision. Collision is returning null. What is collision? Are you using raycast, or physics body for this? I think your problem is collision is returning null.
Sounds like collision is null, maybe you could add a if collision: to your lines, if you expect there isn’t always a collision to process.
You might have to show more of your code, make sure to paste multiple lines as a multi-line code block, with three ticks ``` or [code] and [/code] wrapped around it