Unit doesn't trigger the script

The unit doesn’t get destroyed and the chat message doesn’t get sent, but the player units still get teleported to spawn. Other people don’t see anything wrong with my code either. This probably is a client side prediction bug (just because that tends to be the source of most modd.io bugs). I also can’t turn off client side prediction cause it’s necessary for other things in my game.

2 Likes

that means that the unit is the WASD Unit or Arrow Keys Unit, if u don’t want that to happen switch the unit, if it isn’t either one of these units than that means that’s just a Moddio Bug, unless u forgor to switch the == to =!

1 Like

Yea it’s just a modd.io bug, I’ve tried deleting the units in multiple ways all of which didn’t work. I’ve also had this same problem in the past with previous games

1 Like

Then turn on ‘Run on client-side’ on the script.

1 Like

Good idea, didn’t work though. I also tried deleting the unit in entity scripts with client side off and on, that didn’t work either.

1 Like

Can you show the default body of the unit types that aren’t triggering the script?

1 Like

@kyle691 Sorry for the late response, anyway these are the 2 body types of the unit that don’t trigger the script. They’re pretty much the same except 1 collides with units and 1 doesn’t.

2 Likes

You need to use dynamic bodies. Kinematic bodies won’t trigger ‘when a unit enters a region’.

2 Likes

owners got lazy while working on kinematic???

1 Like

I guess I have to wait for that bug to be fixed then, cause those units are moving platforms and I can’t have them be dynamic. I tried doing projectiles but those can’t move if they are kinematic. Now I remember why I never finished this game lol

1 Like

Why can’t you have them be dynamic? If you don’t want the body to be movable by other units you can set its density to a large value.

2 Likes

Yea I probably could do that, but honestly I just feel like waiting till some more bugs get fixed to start working on the game again. It’s been 5 days and I still don’t have this simple core mechanic working, and who knows what bugs I’ll come across when I’m not coding something trivial. Too much effort for a game that was meant to be quick and easy.

1 Like

i think my game has a similar issue, the player is not spawning in when you spawn!