Is there a way to use a raycast or area2d or any other node to detect other scenes or nodes that are inside it?
I'm trying to make a bullet the player can shoot to kill enemies it hits. The enemies are basically just animatedsprite2d nodes with a point light attached. They don't have a collision shape. Is there a way to detect other nodes/scenes without using a hitbox of some sort, and is there a way to get a reference to the node/scene the raycast hit?
#Raycast stuff
1 messages · Page 1 of 1 (latest)
Raycasts and areas are physics constructs, they can't "see" anything that doesn't have a collision shape
oh
Why don't you want to use collision shape if you don't mind me asking? Since this is kinda the exact stuff hitboxes are designed for
it's just that my character isn't a characterbody2d, so it gives me an error if i use a collision shape on it. Does that matter, or will it work anyway?
enemies too
Ah yeah that will matter, why not just change them all into character bodies?
should I?
Well they are characters, and you need the physics system for your purposes
So it makes sense that they should be
i guess
You could use AnimatableBody2D but probably makes more sense to use CharacterBody
would I be able to replacce the characterbody2d script with the character script i already have?
There's no script to replace
It's a node
You'd just attach your characer script to the node
And change your extends declaration to extends CharacterBody2D