ok i am making a little game for the heck of it and its a rts game. i want it so that if you ckick on a unit you till select that unit and if you click anywhere else that is where the unit will move to.
Well im no scripter but you could esaily do it using logic bricks and goran’s script for getting the mouse position in 3d space here is a blend you just click on the cube and then click anywhere on the plane to set a marker or “waypoint” and to set a new one you have to first click on the cube again and as far as the cube moving to the way point i tried that but for somereason the cube goes baserk so maybe someone could help you with that part.
rtsmovement.blend (317 KB)
that helped alot but im now stuck on how to get the cube to go to the marker
ya well what i tried was a allways senser attached to a track to marker and a simple forward motion but it spazzes out
thats the first thing i did to
hmm does anybody have any ideas that could help him out?
How about the Pathfinding Blender offers since 2.59?
You just tell the Object to go to the Marker and it will do that, Pathfinding inclusive.
ok how do i use pathfinding
Logic Bricks. It is the »Steering« Actuator, where you choose »Path following« and set your Marker as the Target Object. The trickier Thing is the Navigation Mesh. That one must first be built out of the Scene. You select the Objects in your Environment that are about the Region to walk on, go to the Scene-Panel (right after Render but still before World – you’ll use it not very often…) and there you click »Build Navigation Mesh« and the Navigation Mesh will be built so you can set it in your Steering Actuator.
ok i need help i cant find the steering actuator