Make wind tower enemy tracking

Hi, i want to make a tower with “lapwing” track the cube , without leaving the same place, but at the same time , when i move the cube , the tower track the movement to throw the cube away from the floor… i tried but is not doing right… Any help?
Thanks in advance
https://mega.co.nz/#!mcoUzYhY!z5QrYDA7FwJb_PL3JKdHh4aYaYqY_hveRkQGAO4ZWzs

If I understand you right, you want the tower to rotate on the Z axis to point it’s spinning windmill at the cube?

  1. First, select everything (a) and apply rotation&scale (ctrl+a).
  2. on the ‘Enemy’ object, give it a Edit Object actuator, and set it to Track To. The settings there should be obvious enough for you to set up the rest.
  3. on the ‘lapwing’ object, check the L button next to its rotation in the Motion actuator.

As for having the propeller ‘blow’ the cube away, you probably need some python script. Not that its overly complex, just not something you can do with logic bricks only.

I tried what you said…and if i´m doing right , is not working well… :confused: for now is want for example when i move the cube the tower track to same place … but the lapwing is like crazy or something :confused:

Here’s Your blend with a few minor changes:)
I think this is what you are trying to do, minus the cube being blown away.
When modeling stuff, especially if it’s going to be rotating, it’s best to keep the axis’ in mind.

Attachments

windEnemy.blend (1.02 MB)

Hey, yes its working :slight_smile: thanks a lot… what you did , i tried . but was not working. you did something different?

All I did was (ctrl+a) apply rotation&scale like Nines said and the moved the models around in edit mode to get them realigned with the axis’.

wind
add a ray sensor or a radar sensor to a object

assuming your using the x axis of the wind object

import bge

cont = bge.logic.getCurrentController()

own= cont.owner

ray= cont.sensors['Ray']

if ray.positive:
    ray.hitObject.applyForce((own.worldOrientation.col[0]*Multiplier)/own.getDistanceTo(ray.hitObject),0)

Thanks you all. if I have more problems with this I write here…
Cheers

Hi, I did not like you said … but I did it this way, what do you think about it to simulate wind?

https://mega.co.nz/#!yNRh2J7S!Wm8Hozs0aPqtco9rYuf68rLaLZfmCLbRpQNWezLR1XA