How do I roll on a slope

Get help using Construct 2

Post » Tue Mar 11, 2014 3:34 am

When I add a slope sprite to my game and setup the behaviors for it, the ball doesn't roll up or down the slope, instead it just stops. It basically just rolls "into" the slope a little, then you have to jump and move right a bit. As you can see below:

Screenshot (10).png

Screenshot (11).png





How do I get the ball to roll up and down a slope?

P.S.

For each slope object and part thereof, I have set "Physics" behaviour to it and Set "Immovable" to "Yes" and set "Collision mask" to "Use collision polygon" - I've also tried setting it to "Bounding Box" with no luck.
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 12
Reputation: 444

Post » Tue Mar 11, 2014 6:54 am

Could you provide a capx. or make a new small capx that illustrates your problem, then it could be easier for us to debug.

Have you made sure your collision polygon follows the edge of the slope as you would expect?
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Tue Mar 11, 2014 7:13 am

Thanks @cvp - I have now uploaded the capx file. Could you please check it out?
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 12
Reputation: 444

Post » Tue Mar 11, 2014 7:48 am

As i expected, and wrote in my post ;)

You need to fix your collision polygon:

Image

Edit your image and select the collision polygon editor in the bottom of the menu on the left.

Then move the red corners to match your tiles outline better (you can add more delete corners etc)

You need to make it look like this:
Image

That should do the trick
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Tue Mar 11, 2014 8:50 am

Message: spikey is not yet permitted to post plain text URLS (300 rep required). 10 URLS removed. Why?
Wow, thanks so much @cvp! I haven't been able to test the result after following these instructions though because for some reason I now keep getting an error when I Run the layout:

---------------------------
Message from webpage
---------------------------
Assertion failure: undefined

Stack trace:
Error
at assert2 ()
at SetAsVector ()
at SetAsArray ()
at createBody ()
at postCreate ()
at createInstanceFromInit ()
at createInitialInstances ()
at startRunning ()
at go_textures_done ()
at go ()
---------------------------
OK
---------------------------

Do yoy know what causes that?
B
6
S
1
Posts: 12
Reputation: 444

Post » Tue Mar 11, 2014 9:05 am

Not from that no. sry. (capx debugging is hard without the capx)

Try to revert the resent changes you have just made. You apparently did something Construct 2 didnt like :)
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Tue Mar 11, 2014 9:07 am

Update:

If I click "OK" button on that error that pops up, the game still displays properly and I tested it and I was able to roll up and down the slopes perfectly :) Thanks for your help @cvp! When I revert the changes (exactly as you described), the problem still exists. I then reset my browser cache and deleted all history, cookies and other junk. After doing that I am no longer getting the error. :-D
B
6
S
1
Posts: 12
Reputation: 444


Return to How do I....?

Who is online

Users browsing this forum: eochranek, Unconnected and 18 guests