Using mouse to move object
Blitz3D Forums/Blitz3D Programming/Using mouse to move object
| ||
I am trying to create a strategy game using mouse to move the character(in third person). When I will click on place the character will go there. how to do that? (sorry about my english) |
| ||
Something like this should work .... Initialise ... plane = createplane() : entitypickmode plane, 2 target = createsphere() : entitycolor target, 255,0,0 player = createsphere() In the main loop .... Picked = camerapick( mousex(), mousey() ) if Picked = plane positionentity target, pickedx(), pickedy(), pickedz() endif if entitydistance( player, target ) > 10 turnentity player, 0, deltayaw( player, target )*.1, 0 moveentity player, 0, 0, .5 endif The target is a sphere to show you where you're moving to .. normally a pivot would suffice here. Hope this helps. Stevie |
| ||
Dont know if it helped Amitjf or not, but it certainly helped me, Thanks Stevie |
| ||
Your welcome ... there's alot to be said for common curtesy ;) |
| ||
I believe the word is spelled "courtesy". :) |
| ||
Well, that wasn't very courteous... |
| ||
lol- i believe he likes good manners, not spelling, thats where spell check comes in for me |
| ||
Waht, bnieg hfpulel is desicruotous? Sllpieng maktsies are wnorg to hlep poelpe to cecorrt? Srory, did not maen to be drouiscoutes. (recent discovery: as long as the first and last letters of a word are correct, you can mix up the internal letters of a word, and people can still read them, as the human brain unscrambles them and knows what's being written.) But seriously, I wasn't out to diss anybody, and am sorry if it was taken that way. Apologies to all. |
| ||
Well, your mostly correct. I have no idea what 25% of those words say ;) |
| ||
oh no, somethings taking over Sir Gak's mind and making him discourteous*, no spare him, ah nno ti's getttnig mie alos, hepl i don wanat be incosniderit†. *indicates words I used spell check for †indicates words I used spell check for, but then decided to screw it and leave it the way it is. |