You problem in next - radar sensor look to +Y, angle == 0, actuator steering go front axis X - collision not possible, assign radar equal motion direction +X, and assign radar angle more 0, and assign radar detect in True mode (left quadrat icon three point) and check property objects activate radar if in object not property ‘target’ sensors not activation
So name the cube target, not have target as a variable as a float? And the AI as ai1.
I tried radar again, no change, I followed you’re instruction, as best as I understand.
Ohhh dude, if radar or ray sensors not detect objects need check - range, angle(if use radar) and detection property, if this is setups right - check actor state in physics because detected only actors objects, if this not work check object scale - standart work scale 1.000 xyz, size somebody 0.345 not work right. For looking radar detected zone select and activate visualization physics for debugging range and angle sensors. If this not solution problem create all again - new blend file or upload you blend.file here
Everything I have done is pretty default. I can upload the file here, but remember it works in Blender game engine, not the upbge, it could work I would guess, just bricks right? Must be.
aispeedbricktheoryAug15.blend (422.9 KB)
So you can try you’re suggestion, you’d need to select the brick and change to radar, and name target cube.
aispeedbricktheoryAug15 (1).blend (507.7 KB)
i assign more distance for sensors ray and radar and all logic detect object and delete working
Oh, in you’re example, you use a ray and a radar brick for different cubes. Why not all of them, ray or radar? And why does the Target cube not move to plane.001 since that is based off my file example. I tried to select plane.001 for the steering brick on target, but no movement.
this is a demonstration that both the beam and the radar work with the correct setting, so I did not choose one thing for plane001 to go-check the logical bricks there I turned off the check mark (the brick is sort of shaded) - temporarily so that the logical block does not work and is saved at the object
I tried using a message brick and a steering brick for one of the objects, I am not sure if a second layer is needed for this to work. Once the first few are removed, the last would need to be switched to speed it up.
aispeedbricktheoryAug19.blend (439.8 KB)
I tried a property, two of them, and a steering for ai4. It needs some sort of changed event. It won’t work since there is only ai4 if ai3 removed ai4 must use new steering brick with 4,500 velocity, but ai4 needs to speed up with a new steering brick once ai1 or 2 or what ever is taken out by target object.
aispeedbricktheoryAug19.blend (440.2 KB)
Or if ai2 removed then ai4 is sped up, I got the wrong object, but yes the theory still applies to one of them.
Having given some recent thought, like the past half an hour, I should simply setup a sensor for the AI at the back once crossed the line or tough the object, it speeds up. It requires a switch option doesn’t it.
Self terminated could work to switch the steering brick off, and somehow switch the one at the bottom on to speed up, after touching a sensor.
So for ai4 there is a state, so as you seen, collision with sensor, it should use steering.001 to accelerate much quicker, as the velocity is 3.000. It can only be a property or message?
aispeedbricktheoryAug28.blend (444.8 KB)
target was setup to just remove the ai as a basic demo, the ai would be removed by a bullet. So the task is to get the ai further back to speed up as I already stated a few times already.
Use the beam throw to the target with objects enemies -
start = own.worldPosition
end = player.worldPosition
ray = o.rayCast(end, start, 0, ‘player’)
hit = ray[0]
if hit:
if not ‘player’ in hit:
steering.velocity = 1.000
elif ‘player’ in hit:
steering.velocity = 3.000
thus, if the enemy does not see the player, he has a standard speed, since obstacles and other enemies block the line of sight-otherwise, if the beam hits the player, it will accelerate
Not sure what that is, beam throw?
So this is the code for or how to get the ai4 to speed up, but the speed up would only happen, once past a certain point, since the ai at the front would just be steering brick only ai, which work fine, only those at the back that travel at a certain speed, because if they travel to too quickly, they crash into the front and the mini game doesn’t work well that way, as it is brick programming.
- A beam throw(own.rayCast()) is an analog of a beam sensor, but unlike a sensor, you yourself control the direction of the beam, its length, and set the reactions to which it should react - whereas a sensor without a script has only the main directions of the XYZ axes. And with the beam throw, you can check any direction from the object to the target, position or vector and get not only a hit in something, but also get the normal and position
You do not have a tab after the colons starting with ‘if hit:’ - the script will not work without it - if something does not work - open the script or script module in the windows item at the top next to the menu-system console and see where you have errors-this will give you the opportunity to eliminate them and also, ‘always’ put the sensor in a constant pulse mode - the icon of three points like the radar/beam sensor, otherwise the script will work only once at the start and will not work anymore
I copied what you posted as is,
So this is now like this.
start = own.worldPosition
end = player.worldPosition
ray = o.rayCast(end, start, 0, ‘target’)
hit = ray[0]
‘if hit:’
if not ‘target’ in hit:
steering.velocity = 1.000
elif ‘target’ in hit:
steering.velocity = 3.000
I then clicked on the pulse for ai4, no change.
start = own.worldPosition
end = player.worldPosition
ray = 0.rayCast(end, start, 0,‘target’)
hit = ray[0]
‘if hit:’
if not ‘target’ in hit:
steering.velocity = 1.000
elif ‘target’ in hit:
steering.velocity = 3.000
simply_pathfinding_steering.blend (121.2 KB)
use this
I loaded the file in 2.76, and nothing works. The objects are 1, 2, 3, 4.
use UPBGE version 0.2.5 based in blender 2.79, because in bge 2.79 freezing dynamic objects from file create in UPBGE and enemy no motion to player




