Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How to move an object toward cursor?
Old
daveelton
Guest
 
Status:
Posts: n/a
Default How to move an object toward cursor? - 10-01-2006, 05:27 PM

Hello all,

I am looking for a way to have an object move toward where the mouse was clicked (a person is throwing an object into the distance, and gravity can be ignored for simplicity... a straight line throw toward the cursor is good enough). I thought about creating an invisible "target" and moving it to the location that the mouse is clicked at and then have the object move toward the target, but it turns out that even moving this target to the location of the mouse when it is clicked is more difficult than I had imagined... the only mouse related functions I can find are world.mouse distance from left edge and world.mouse distance from top edge... which I can think of a way to use these values if there is a way to find out the height of the world (the width shouldn't be as important since measurement from the left should start at 0), but I have not had any luck with finding that value either. Any ideas? Thanks in advance.
   
Reply With Quote
uhhhh...
Old
Mr Nemo
Guest
 
Status:
Posts: n/a
Default uhhhh... - 10-01-2006, 08:52 PM

Unless maybe one of the admins knows how to do it, I don't think it's possible, man.
You mentioned an invisible target. That would be a viable workaround, but you would have to cover the sky with hundreds, maybe thousands of such targets to get it to work.

Last edited by Mr Nemo; 10-01-2006 at 08:54 PM. Reason: clarity, and hope
   
Reply With Quote
Best you can do (?)
Old
DrJim
Guest
 
Status:
Posts: n/a
Default Best you can do (?) - 10-01-2006, 10:31 PM

Think the attached is the best you can do (see note).

It' kinda fun though.
Attached Files
File Type: a2w followTheMouse.a2w (187.4 KB, 617 views)
File Type: txt followTheMouse note.txt (944 Bytes, 500 views)
   
Reply With Quote
Old
Mr Nemo
Guest
 
Status:
Posts: n/a
Default 10-01-2006, 11:47 PM

I've gotta say that's quite an interesting treatment of the problem. I can definitely say that I wouldn't have thought of that.
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 10-02-2006, 12:43 AM

If you look at the main Alice screen, that's essentially how they handle camera and object movement - with, of course, a mouse click selection, the shift key to force movement normal to the plane (and a lot of normalization, I'm sure).

Jim
   
Reply With Quote
Old
daveelton
Guest
 
Status:
Posts: n/a
Default 10-02-2006, 08:07 PM

Thanks for the thoughts. I think what I'm going to try is to have several floating "near miss" targets around the actual target that the player is trying to hit and set each of their vehicles to be the actual target... just thought I'd throw the idea out there in case anyone else ever comes across a similar problem in the future.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.