Page 1 of 1

How do I move an object without rotation?

PostPosted: Sat Mar 26, 2016 7:36 pm
by mimiha
Hello.

I am making an interactive map. When the mouse hovers over 4 "hitboxes" (n, s, e, w) the map is supposed to move in that direction. However I can't for the life of me figure out how to move objects without them physically rotating. I want the map to move east when I'm hovering over the east hitbox (I guess that is a 0 degree angle?), but I can't make it go to that angle without the map turning on its side.

I tried several things before the hitbox idea (pinning, scrollto, bullets) but I think this is closest to what I want, I just don't know how to move an object without it turning towards that angle.

What I'm using right now is a simple:
Code: Select all
if mouse over hitbox
   Set angle to (whatever) degrees
   Move forward 2 pixels


But setting it to, say, 270, makes the whole map flip on its side.

Re: How do I move an object without rotation?

PostPosted: Sat Mar 26, 2016 9:47 pm
by briggybros
Don't use a behaviour?

Something like:

every tick, if mouse is over west, map.setX to map.X + 2

Re: How do I move an object without rotation?

PostPosted: Sat Mar 26, 2016 9:59 pm
by oosyrag
Or, if you did want to use a behavior, bullet should be suitable. There is a property you can set for the bullet behavior "Set Angle". If you change that to "No", then the object will not turn while moving.

Re: How do I move an object without rotation?

PostPosted: Sun Mar 27, 2016 1:44 pm
by delgado
if you wnt rotate sprite without change angle, use bullet behavior
set in bullet proporties- set angle 'no'