The Daily Click ::. Forums ::. Klik Coding Help ::. Angle problem in MMF 2
 

Post Reply  Post Oekaki 
 

Posted By Message

Roisipatukka



Registered
  25/09/2007
Points
  2
26th September, 2007 at 04:29:01 -

Set Object2 X --> X( "Object1" )+Sin(Anglebp( "Angle Calculator", XMouse, YMouse, X( "Object1" ), Y( "Object1" )))*50
Set Object2 Y --> Y( "Object1" )+Cos(Anglebp( "Angle Calculator", XMouse, YMouse, X( "Object1" ), Y( "Object1" )))*50

I copied that formula from some tutorial. It makes Object2 follow the mouse and stay in certain distance from Object1, i used it to make crosshair.
It worked fine in MMF 1.5 but when i try to do that in MMF 2, the crosshair is always 90 degrees off from where it should be. No matter which one of the angle calculating extensions is used.

Why is that?


 
n/a

Nuutti



Registered
  26/10/2003
Points
  1364
26th September, 2007 at 07:40:51 -

I'm not sure about this, but try using Cos in setting the X position and Sin in setting the Y position. I think those 90 degrees might have something to do with it, as cos( n-90 ) = sin( n ). So try switching the places of those sin and cos.

Image Edited by the Author.

 
P.S. sorry for my mangled english.

Roisipatukka



Registered
  25/09/2007
Points
  2
26th September, 2007 at 08:14:32 -

Yep, now it's working. Thanks!

 
n/a
   

Post Reply



 



Advertisement

Worth A Click