Custom gravity forces not being applied to player with wall stick system

Hello! Basically I am trying to create a game with custom gravity fields that apply forces to objects and players, the players being able to walk on walls, the ceiling and so on. The normal gravity is turned off as well to not interfere with how the game is supposed to work. Also the gravity controller is modified so only parts called grav-part can change the avatar’s position.

(Credits for workshop systems: wall stick / gravity controller is made by EgoMoose, custom gravity field / force applier made by Konethorix)

There is an issue tho, relating to how the wall stick system works basically, it functions in a specific way where the avatar the player steers is in some ways controlled by a copy of the avatar, let’s call it a phantom avatar, existing in a so called PhysicsWorld in the Workspace far far away from action. Specifically it creates a copy of nearby objects with collisions in PhysicsCollission and makes it rotate for the phantom avatar instead of rotating the phantom avatar, which stays in the same position, this in turn makes the avatar the player controls rotate and face the surface they want to stand on. The phantom avatar, being always in the normal position, is pushed downwards by gravity which is translated onto the normal avatar so we are able to walk on walls and so on.

(Yes I do want to have it so some areas have no gravity and others have gravity, otherwise all of this wouldn’t be that much of a problem.)

aeugh

For instance, if the world gravity is set to 0 and we walk into a gravity field which impacts everything and pushes it down, the avatar the player controls is not affected by it because these forces are being removed instantly by some system I can’t find, it’s so only the phantom avatar controls such things, now the biggest problem is that the objects copied into PhysicsCollision are the ones which have collisions, and the gravity fields don’t have collisions, so they are not copied, even then, scripts are not being copied either so we’d have to make it so the wall stick system copies every nearby thing into the PhysicsWorld- that would be problematic tho, could result in some systems not working, for instance portals.

I have tried many things, attaching parts to the player avatar so it pulls them down, but the forces are not impacting the objects either then, attaching them by other means is glitchy- it seems as even if the player was being pulled down by the blocks it would not affect them unless it somehow impacts the phantom avatar in the PhysicsWorld as the position of the normal avatar is connected to the position of the phantom one.

One thing that does give the phantom avatar own gravity is when the player sits down on a seat, this results in the PhysicsWorld being removed as it’s not needed, and if the player is sitting in a gravity field, the forces are applied to them normally, now when the player gets up, the phantom avatar copies the normal avatar’s HumanoidRootPart and Head, both containing the forces that pull them down, this will stay constant though until the player sits down in an area with no gravity field and then get up, results in the parts being copied but without the forces that pull them down.

Video that shows it:

Lastly- these systems are complex and if I’d post every script here and comment on where it’s located exactly, this post would be very long to say the least- so I am posting a world that can be downloaded and tested, containing the scripts and bare minimum of other things needed to test everything. I am thankful for any help!

Gravity system.rbxl (229.9 KB)

TL;DR: Gravity controller works in a funky way where a copy of the avatar (phantom avatar) and nearby objects with collisions (PhysicsCollision) control the actual player avatar’s gravity. That makes a custom gravity field not impact the player avatar and results in them always being in 0g, as the forces applied to the avatar are being removed, and the fields are not copied in the PhysicsCollision due to the fact it only copies objects that can collide, not even scripts etc, and I am looking for a way so make it so either the player avatar impacts the phantom avatar so the gravity fields work on the player, or so the gravity fields are copied into the PhysicsCollision world and impact the phantom avatar directly.