RockyMadio
(RockyMadio)
1
Hi All
Could someone help my bad to fly o.o? I dont know why it keeps giving this error. I got these parameters fromhere
from bge import logic
def main():
cont = logic.getCurrentController()
own = cont.owner
scene = logic.getCurrentScene()
obs = scene.objects
seek = cont.sensors['seek']
atk = cont.sensors['atk']
steer = cont.actuators['steer']
if seek.positive:
steer.distance = 400 #0 to 1000
steer.mode = "seek"
steer.facing = True
steer.target = obs['main']
steer.turn_speed = 100 #0 to 720
steer.velocity = 500 #0 to 1000
cont.activate(steer)
main()
hilkojj
(hilkojj)
2
The parameters you’re using are from the blender 2.64 api documentation.
Use the parameters from the 2.74 documentation instead.
So ‘steer.mode’ will become ‘steer.behaviour’ and “seek” will become one ofthese constants.
RockyMadio
(RockyMadio)
3
Thanks hilkojj .It still gives an error saying "no attribute “behavior”. I tried to replace the value as a “1” and also logic.KX_STEERING_SEEK.
RockyMadio
(RockyMadio)
4
o.o oh your word was wrong and i just pasted it into my code
edit: it still does not work…
from bge import logic
def main():
cont = logic.getCurrentController()
own = cont.owner
scene = logic.getCurrentScene()
obs = scene.objects
seek = cont.sensors['seek']
#atk = cont.sensors['atk']
steer = cont.actuators['steer']
if seek.positive:
steer.distance = 400 #0 to 1000
steer.behavior = 1
steer.target = obs['main']
steer.turnspeed = 500 #0 to 720
steer.acceleration = 100
steer.enableVisualization = True
steer.velocity = 1000 #0 to 1000
cont.activate(steer)
main()
hilkojj
(hilkojj)
5
Oh, I’m really sorry about that. I will check my answers before I post it next time.
Does it still gives the same error 'no attribute ‘behavior’?
Edit: does thishelp?
It gives no error, but the lil bat doesnt move. T.T