Changing the direction of gravity

Kraftwerk

L2: Junior Member
Jul 10, 2009
86
4
Is there any way that the direction of gravity on the map can be changed midgame? Either that, or have different sections of the map with different directions of gravity? I know this probably isn't possible, but I have several ideas (for tf2 maps, and for other source maps) that would rely on this kind of thing.
 
Feb 18, 2009
640
629
I think not. I believe it is hard coded into the engine to pull the player downwards. You could possibly create a func_push pushing the player upwards with the exact same force (not sure what value that is) and another, again with the same force, pushing in the direction you want the players to go. That probably is going to be quite buggy but if used in moderation could provide you with a fix.
 

Kraftwerk

L2: Junior Member
Jul 10, 2009
86
4
I think not. I believe it is hard coded into the engine to pull the player downwards. You could possibly create a func_push pushing the player upwards with the exact same force (not sure what value that is) and another, again with the same force, pushing in the direction you want the players to go. That probably is going to be quite buggy but if used in moderation could provide you with a fix.
That wouldn't quite work. It would need to completely re-orient the characters view, and they'd need to be able to move around like normal.
From what I remember its busted in TF2.
Well...T hanks. I guess I'll just have to wait for source engine 2 to try any of this :p
 
Feb 14, 2008
1,051
931
Safe to say, no you couldn't do this in TF2, though there was this source mod that did something similar to this, but it was all custom coded.
 
Last edited:

gcone81

L1: Registered
Nov 27, 2009
37
3
I think the most you could do with gravity would be to make it pull players in the exact opposite direction. This way, they would be pulled upwards instead of downwards. This could be done by sending an sv_gravity command to the server with a negative value instead of a positive one.

You could make it so there is absolutely no gravity by sending an sv_gravity command with a value of 0.
 

megawac

L4: Comfortable Member
Oct 2, 2009
180
29
I was thinking along those lines aswell gcone, but with a trigger_gravity encompassing areas/your entire map.

Also you could probally fake it other directions by setting the gravity to 0 and using trigger_push enties.

PS not sure if making it a negative value will make players land on their feet or stick to the ceiling.
 
Last edited:

gcone81

L1: Registered
Nov 27, 2009
37
3
I was thinking along those lines aswell gcone, but with a trigger_gravity encompassing areas/your entire map.

Also you could probally fake it other directions by setting the gravity to 0 and using trigger_push enties.

PS not sure if making it a negative value will make players land on their feet or stick to the ceiling.

I never thought of that but you're right; you could set the gravity to 0 and use the pushes to make it seem like its going in a different direction.

I've tried negative gravity values before and, although it will pull the players upwards, they won't flip and have their feet on the skybox. They'll remain upright.