[Solved] "Set Gravity = 0" doesn't seem to work

Get help using Construct 2

Post » Fri Dec 26, 2014 5:13 pm

I have a top-down tilemap with a sprite. I need physics to apply a force on certain controls. I can do all of this fine, however "set gravity = 0" on the sprite is not working. The sprite simply drops to the bottom of the screen. Other "set gravity = 0" what else must I set?

Thank you, thank you, thank you for your help :-)
Last edited by locohost on Mon Dec 29, 2014 10:34 pm, edited 2 times in total.
B
13
S
4
Posts: 280
Reputation: 1,578

Post » Fri Dec 26, 2014 6:35 pm

If you set gravity to 0 after applying force I think the object will keep it's movement. Try to stop the object's movement where it is and then set gravity to 0. However I don't know if it will work and also I don't know what's the goal.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Fri Dec 26, 2014 7:19 pm

Set gravity = 0 works for me. But you must zero both X and Y vectors if the object is already moving.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 428
Reputation: 2,337

Post » Sat Dec 27, 2014 2:54 am

You need Vector Y to be zero.

Read on Platform behavior in manual. Unless you disable the platform behavior itself, it will still free fall even if gravity = 0.

https://www.scirra.com/manual/100/platform
read on
Set enabled
Set ignoring input
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sat Dec 27, 2014 5:37 pm

I've tried setting the x/y vectors to zero both before and after setting gravity to zero. In both/either case, the ball drops to the bottom of the screen.

See attached screen clip...

https://www.dropbox.com/s/ovek2apd4874eb5/Construct2_Event_Layout_Start.PNG?dl=0

Thanks again for your advice and help :-)
B
13
S
4
Posts: 280
Reputation: 1,578

Post » Sat Dec 27, 2014 5:53 pm

kossglobal wrote:If you set gravity to 0 after applying force I think the object will keep it's movement. Try to stop the object's movement where it is and then set gravity to 0. However I don't know if it will work and also I don't know what's the goal.


The goal is to create "top down view" of the tilemap. The default gravity is not "top down view" its a side view for platformer games. I've read in numerous articles and posts that state you simply set gravity to zero in the layout start event. I'm doing this, in addition to setting the ball x and y velocity to zero and the ball still drops to the bottom of the screen. There is some other setting somewhere that I'm missing.
B
13
S
4
Posts: 280
Reputation: 1,578

Post » Sat Dec 27, 2014 6:00 pm

sgn15 wrote:You need Vector Y to be zero.

Read on Platform behavior in manual. Unless you disable the platform behavior itself, it will still free fall even if gravity = 0.

https://www.scirra.com/manual/100/platform
read on
Set enabled
Set ignoring input


How can I "disable the platform behavior itself"? Do I not use "Physics"? Use some other "Movement" setting?

Thanks :)
B
13
S
4
Posts: 280
Reputation: 1,578

Post » Sat Dec 27, 2014 6:06 pm

I'm trying "Car Movement" behavior on the ball instead of "Physics" behavior which defaults to a side-view platformer game world. Not sure if this is the right way to go or not. Lets see what happens...
B
13
S
4
Posts: 280
Reputation: 1,578

Post » Sat Dec 27, 2014 6:40 pm

locohost wrote:I'm trying "Car Movement" behavior on the ball instead of "Physics" behavior which defaults to a side-view platformer game world. Not sure if this is the right way to go or not. Lets see what happens...


Dropping Physics behavior and using Car or 8Direction movement eliminates the Platformer gravity that drops the ball to bottom of screen. I can rotate to different angles and change acceleration, so that's something positive I suppose. However Car/8Dir are not the right movement physics for a ball rolling on a flat (top-down) surface. It doesn't move correctly.
B
13
S
4
Posts: 280
Reputation: 1,578

Post » Sat Dec 27, 2014 8:42 pm

No need to set gravity to zero. If you do not wish to let your ball fall down then do this

On start of Layout = sprite set physic disabled
B
250
S
39
G
15
Posts: 1,953
Reputation: 40,623

Next

Return to How do I....?

Who is online

Users browsing this forum: David181, OBLIVION and 61 guests