Match Character angle to angle of terrain

For questions about using Classic.

Post » Thu Aug 25, 2011 5:01 am

Hey, could anybody help me out, I was trying to figure out a way to make my character rotate to match the angle of the ground he stands on.

I found a rather brutish way of doing, but it occasionally doesn't work at all, and sometimes triggers epileptic angle switching until you move to flat ground.

here's a cap



I am sure someone's solved this before, but i haven't had much luck searching for it, it's a hard thing to phrase.the_chosen_byte2011-08-25 05:05:59
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Thu Aug 25, 2011 12:45 pm

I'm not sure about the issue, but I know that you shouldn't have the "else" events as sub-events just place them beneath the other events.
B
149
S
75
G
20
Posts: 1,791
Reputation: 22,695

Post » Thu Aug 25, 2011 1:57 pm

Can't give a detailed answer at the moment. But the easiest way would probably be to have the ground sprites angle actually be the angle the character needs and then set the character to the angle if overlapping groundsprite at offset 0,10, or have the ground sprite communicate its drawn angle through a pv or some such thing
Spriter Dev
B
99
S
21
G
12
Posts: 3,259
Reputation: 16,894

Post » Thu Aug 25, 2011 4:05 pm

Try this:


(It's basically what lucid suggested)

B
21
S
6
G
8
Posts: 1,215
Reputation: 7,881

Post » Fri Aug 26, 2011 6:06 pm

@chrisbrobs/lucid

seems to work well enough, only the character remains on an angle when flying through the airwhich is what i was trying solve with my "else" event...

works for now though, thanks!
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Thu Jul 02, 2015 3:21 pm

@chrisbrobs The link is broken! Could be really useful
B
9
S
3
Posts: 152
Reputation: 1,270

Post » Thu Jul 02, 2015 8:05 pm

@CloveItOc Here's an example of that: https://dl.dropboxusercontent.com/u/471 ... dAngle.cap

This is for Construct Classic though (which is free, latest can be downloaded from the link here: http://ihadhope.blogspot.ca/p/download.html as the one on the Scirra site is outdated), so if you wanted to use Construct 2 the events/logic is similar (without the work-around that separates animation angle from real angle, as C2 has that), so you can instal CC and look at the cap.

Hope that helps!

The graphics in that cap were from the forums, but I didn't remember who shared them sadly.
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
121
S
42
G
17
Posts: 2,219
Reputation: 19,800


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests