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
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

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
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Aug 25, 2011 4:05 pm

Try this:


(It's basically what lucid suggested)

B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

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: 128
Reputation: 1,220

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! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests