Speed change collision sensor

Hi,

I thought about this, and I have setup this, so here is the images, obviously it doesn’t work, but where am I going wrong with this. I’ve got the idea correct, but it doesn’t work in practice.


On motion brick, torque is 0.10 for the x axis.

Thank you.

What doesn’t work? Do they pass through each other? Is the collision sensor not firing?

I suspect your property changed sensor isn’t firing on the same frame as the collision sensor, so you’re never changing the motion or toggling the property.

Correct, I tried a different file before that, but it didn’t work out.

So it does collide with the other, but the sensor doesn’t work so once the AI touches the sensor, it should change the speed to increase it going on the x axis?

What frame, they are both on a plane, not sure what would be needed, if the program is correct, the AI should of increased speed.

You’re using an AND controller, which means both sensors need to fire on the same frame for it to work. Are you changing the “ai2” property on the same frame that you’re colliding with things? Because otherwise nothing will happen.

-edit-
Get rid of the 3rd sensor. That should make it work.

There are only two And bricks, not sure what you mean.

The AI2 has a steering, so it has velocity, but then there is a motion brick which would speed up the Ai2, is that correct?

Did you try deleting the third sensor?

You mean the speed sensor? Then how would the ai2 move at a faster speed without a sensor to trigger that?

This is how problem solving works. You simplify the setup until things work, then you add the complexity slowly and figure out where you went wrong.

Forget the faster speed for now and focus on your original problem.

Hmm, that is the task? I tried this late last month, then somebody suggested using python code, so I decided to try this again, but use a sensor as I thought at the time, the other was using a ray to catch up once AI were removed, so Ai at the very back.

So this task is similar, but just collides with an object and speeds up.

ai2speedchange.blend (408.1 KB)

Here is the file, so what am I doing wrong?