Enemies AI Behaviour for Platformer behaviour

This can interpreted as a Feature request and as an “How do I” thread since i’ve never created a behaviour myself.

Before read i apologize for my english…isn’t my main language.

First question: can C.object be shared as a behaviour?

explanation:

I’ve a pretty good enemies AI behaviour in my game that i would like to turn into a c.object usable on any created(placed) object into the scene that can hopefully be shared so it can help other user…

Actually i’ve this function rdy:
-patrol
-chase player
-attack while chase
-disengage
-auto detect slopes platforms edges

in this behaviour every option is separated so it can be customized…

Now the problem:
i need to detect the collision boxes.

Let’s say i place an object into the scene.

The moment i attach the behavior to that object, i want the collision box of the c.object to automatically fit the collision boxes of the placed object (at the moment just rectangles ones)…

what i wanna do is on created step fit width and height of target collision boxes automatically

now…i don’t want to use the bounding box…cos wel…they 're bounding box…not collision masks.(.i want them to be customizable)…

Do you know anything or any method that can be used to automatically fit collision boxes to any target object’s collision mask…(as i said just 4 points/rectangles atm)?

I was thinking to input width and height at creation but i wonder if there are better options.

eDIT: now that i’m thinking this could be an extension of the platformer behaviour…since when binded to object it add collision and 2d physics to that object…automatically…am i wrong?

Anyway…since i don’t have pratically any experience in custom behaviour better consider this as a feature request…

2 Likes