Godot Version
var body = left.get_overlapping_bodies().name
Question
`Im trying to get the name of something im currently colliding with and the line of code im using to get this info keeps crashing the game HELP
var body = left.get_overlapping_bodies().name
`Im trying to get the name of something im currently colliding with and the line of code im using to get this info keeps crashing the game HELP
I am not sure, but I think the function you are calling is giving you an array, not a single object. You need to pick out from the array which object you want the name from.
Ohhhhh that makes sense
I’m new so I don’t use those types of functions.
Usually I use the built in signals and then reference what they detect like this:
I hope this helps, sorry if that’s not what you were asking.
You could also use node groups, Check if the thing you are colliding with has a group and then you can do whatever based on that
Ok that could work