How do I move to a position ?

Get help using Construct 2

Post » Fri Nov 13, 2015 11:35 am

WeneW wrote:
LittleStain wrote:
WeneW wrote:You could just set "set angle" to "no" in the bullet properties..
And instead of using set angle, set the angle of motion of the bullet..


No. because set angle of motion ask a degree. Wich i don't have. I have a target (object .X and Y) and thats all.

Its a big hole in C2 i think, to at least not have a kind of "lengthdir" function in it...
People could easily code their own tween movements with events if there was just that.
or a simple option "move toward position" with a pixel per tick.

But , you can still use a var to store the angle toward position, then reset angle of the object to 0.
And use this var to set angle of motion.... it works, but OMG its complicated for such a small thingy.


Anyway LiteTween is better i find than moveTo. Hope it'll be stable :s seems pretty heavy behavior


Set angle of movement : angle(player.x,player.y,target.x,target.y) should work..

Also setting a state to moving and while moving move 1 px at angle..
It's all there..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Nov 13, 2015 11:46 am

LittleStain wrote:Set angle of movement : angle(player.x,player.y,target.x,target.y) should work..


my bad !! ^^
It's exactly what i was looking for :D ! (yes, i should read the manual.... duh)
twitch.tv/neozoom/
Dev stream from time to time !
@FireCamp_games <-- twitter
B
6
S
2
G
2
Posts: 52
Reputation: 969

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 57 guests