Can I handle collisions within a custom behavior?

Hi everyone, it’s been awhile, and Happy New Year.

Been trying to give Game making another shake, and this time, I wanted to take the advice from that one article on the wiki, I forget which, and try to have most of my logic for an object within a behavior, by kinda ‘extending’ the platformer character behavior.

I keep running into the issue of behavior objects not being aware of scene objects. Or even other prefab objects within the same extension. I’ve been able to work around that, up until now.

I’m just trying to make it so the character, while crouching, is forced to stay crouching even if the input isn’t held if they end up hitting something.

Is there any way to handle that within a behavior, or would I have to bite the bullet and stick an event in the scene event sheet? Which, would be a little complicated for me due to the way I have my behaviors set up.

1 Like

Sometimes, the hard way might just be the easy way.

Personally, I enjoy events more than behaviours, so I would just stick an event in the event sheet. I’m not all that familiar with the problem you have, so I’m sure someone else will have a great solution! :smile:

3 Likes

Yeah, I don’t blame you there. XD Just using scene is nice and straight forward. Meanwhile, even when it’s going well, doing things with Behaviors is exhausting; I heard this line from an Object Oriented Programming sucks video: “You spend more time making frameworks than actually coding”, and I’m feeling that here, very much so.

I wanted to try out making a behavior cause I like the idea of like, events relating to specific objects not being checked if the object doesn’t exist
But yeah, I’m starting to think it’s not worth it, hah.