Hello. In my game, there will be multiple enemys, with AI and stuff, which is all programmed nicely, except... When it comes to programming their gravity and making them jump randomly, I'm forced to have to create a hidden floor sensor to detect floors (Theres Active floors as well as Backdrop floors). Positioning them individually was hard to do, and the method I ultimatly use is not efficient at all. When doing the positioning and stuff, i give the enemy and sensor an ID each, use the "ForEach" object. And do this:
Value A("Enemy")=Value A("Sensor")
+Position "Sensor" at Enemy.
Works well. But when it comes to detecting the floors and stuff, I have no idea how to successfully do it. For testing purposes, I made the enemys stand still, and upon clicking them, it sets their Gravity to -5 to simulate a jump.
I get some bizzare results. Sometimes the enemy endlessly goes upwards, sometimes all the objects fall through the floor except 1. Sometimes The enemy flies upwards futher than it should THEN starts falling randomly.
Basically, how would i go about creating a sensor for multiple enemies? I'll upload an example of my problem as soon as I can to show what's going on.
Thanks to all.