The Daily Click ::. Forums ::. Klik Coding Help ::. Testing Collisions on specific parts of an object.
 

Post Reply  Post Oekaki 
 

Posted By Message

Greasy



Registered
  15/02/2005
Points
  322
9th June, 2006 at 01:50:16 -

Can anyone help me with doing this, I remember trying a long time ago but I couldn't figure it out. What Im trying to do is make it so if I click on certain areas of an object, ______ happens. Ex. Click on objects head = do this. Click on objects arm = do that.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
9th June, 2006 at 01:59:46 -

Either have different objects as different parts of the body, or compare the coordinates against some point on the object (knowing that anything above Y+32 from the top of the object means you're hitting the head when you click, for example).

 
n/a

Greasy



Registered
  15/02/2005
Points
  322
9th June, 2006 at 05:12:23 -

hmm, I can't seem to do a relative to... thing or anything. Like, All I can do is put, User clicks on object.... and Check For The Mouse Pointer in a zone + User clicks. I Can't test a certain area relative to the object.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
9th June, 2006 at 05:50:58 -

Compare against the ordinates directly, like:

-User clicks with left button on (Active)
+YMouse < X("Active")+32
---[do stuff]

MMF has 'compare two general values' for this, I'm sure TGF has something equivalent.

 
n/a

Greasy



Registered
  15/02/2005
Points
  322
10th June, 2006 at 06:17:22 -

Ah, I understand now, thanks a lot.

EDIT: I have got everything all figured out and working now. Its all good!

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click