#Ship keeps moving down while player is "sitting" at console

1 messages · Page 1 of 1 (latest)

flint estuary
#

I have a ship that uses LinearVelocity and AlignOrientation constraints, which are paired with UIS inputs to control it. I also made a custom movement controller for ship, so players are unaffected by the world reference frame. Issue is, for seemingly no apparent reason, when "sitting" (not really sitting, just setting the HRP CFrame to the AimPART of the console that you've picked), the entire ship moves downwards (in it's local frame, if the ship is upside down it'll move up slowly if you look at it from the baseplate) slowly. I really don't know why this is happening. When the ship is moving on autopilot (no plr trying to "sit" [not using a real seat]), it has no issues with this while players are walking around on it. But when someone sits in the seat and we try to keep them stuck in the same position (while also disabling all the collision and other stuff necessary for free roam walking) it keeps having this issue. I've tried for about 16 hours now to get it to work, and I've hit a dead end. One of the things I tried was to instead use an alignpos/orientation constraint while the Plr sits and set collide = false, but this caused even more (separate) problems of its own...

It's kind a long script and atm it's sort of all over the place with random functions due to using YapGPT for debugging...

#

example of the issue.

#

when walking around normally, this isn't a problem, even when ship is moving.

livid gorge
#

well considering that when its normal it gets pushed down and when its flipped it gets pushed up seems to make me think that when ur placing the player to the aimpart of the console it might be overlapping and causing it to be pushed slightly heres some things you could do to pinpoint the problem:

1.Try changing the mass of the ship make it massless and see if its getting pushed more
2.Try using a vehicle seat and see if this pushing bug still occurs
3.also have u tried welding the character to the ship?

#

Also dont want to be mean so no offense BUT BRO USE SOME MODULES TO DECOUPLE UR LOGIC HOLY IM BEGGING YOU BRO PLEASE 😭

flint estuary
# livid gorge well considering that when its normal it gets pushed down and when its flipped i...

i will use a MS once this is ironed out but this started as a movement test so i kept it as a server script for now.

  1. setting it to massless does not change the rate of the "descent".
  2. can't use vehicle seats due to the custom controller. what I can say is that before I made the movement controller and was using a vehicle seat, it was working fine.
  3. I did try to weld the char to the ship and set collide to false, but for some reason this introduced problems of its own? maybe it's just all the craziness of the overlapping server script...
#

I also tried using alignorientation and alignposition on the HRP and that made the ship seem stable, but after about 30 seconds it starts doing weird flips and shit

flint estuary
#

lol

#

all we had to do was set canQuery to false for the char, solved the issue

#

oh ffs. it works fine, until about a minute when it starts doing the same stuff again... if you use the rotation command on the ship for some reason it starts again

agile rockBOT
#

studio** You are now Level 4! **studio

flint estuary
#

OK hopefully for now i've solved it. set the seat to nonQuery instead, seems to be working

livid gorge
#

wait if u are not welding the character to the ship how are they sitting in the chair

flint estuary
#

The cframe is still being updated

#

I suppose now that I fixed the problem with the ship moving when you’re sitting in the seat, I could change it back to being welded again. Because you don’t have to calculate the math each time i

#

The only problem is, getting it in the perfect spot while the ship is moving at speed in a random direction might not allow for it to align properly so I might just stick with CFrame

flint estuary
#

That’s kind of the whole point of the movement controller. No matter where the ship is, how fast it’s going, or what angle it is compared to the baseplate, the player will always appear to be standing upright on the ship unaffected by it.

livid gorge
flint estuary
#

I did this because every time you try to make a space game like galaxy arcade or something it never has gravity on the ship

#

In fact, using this system, you can have gravity on the ship at whatever amount you want, even if gravity on the workspace is disabled

livid gorge
flint estuary
#

Yeah, I already fixed the problem

livid gorge
#

wait give me 2 seconds

flint estuary
#

I just had to turn off query for the seat

livid gorge
flint estuary
#

So it was detecting the seat near the character. either that or the character near the seat with collision/query on was just imparting some force.

#

either way it seems OK now

#

i also made a custom click detector for this game too

#

that way no matter how fast you're going you can still use buttons

#

i plan to make this a full first person sim of a couple ships

livid gorge
#

wait what are u using to update the character every frame preRender?

flint estuary
#

Heartbeat on the server side. and RenderStepped on the client side so you and other characters don't seem jittery

livid gorge
#

and see if u still get the bug cause canQuery fixing it seems weird.....

flint estuary
#

You need to use RenderStepped for clients because otherwise the jitter would still be present

#

Cuz renderstep is each frame, not in sync with the heartbeat

livid gorge
flint estuary
#

It doesn't

#

The client only controls the camera

#

not the character

livid gorge
#

ohh ok yea my bad

flint estuary
#

the client has 0 control of the character here. only the server script sets the .CFrame based on targetCFrame / current CFrame values

#

ur good

livid gorge
#

hmmm so u run it on heartbeat on server after physics so that it doesnt interfer with the characters position yet its still pushing but canQuery fixes it.....

flint estuary
#

i think it's just the shitty way i wrote the code logic on the server script

agile rockBOT
#

studio** You are now Level 5! **studio

flint estuary
#

somehow the collision is still running even in consoleMode

livid gorge
#

are u on 60 fps or 30fps?

flint estuary
#

whatever the game runs at.

#

physics is 60fps

livid gorge
#

doesnt server run at 30 fps tho?

flint estuary
#

60

#

my client runs at 240

livid gorge
#

I think what could be happening is that since players have full movement control over their character when we position them on the server at 30fps after heartbeat since the player has a higher framerate the server positions them then the player does the physics calculations on their end.

Whats the network ownership of the ship?

flint estuary
#

Server physics runs at 60fps.

#

The geometry of the seat and the raycasts I use are being affected by the seat unless canQuery is off

livid gorge
#

just for now try make it so the player positions themselves to the ships seat on the clientside

flint estuary
#

that's why the issue was fixed

flint estuary
#

yes.

livid gorge
#

oh yea im dumb u use it so u can tell if they are on the ship

flint estuary
#

also it doesn't make sense to not replicate character movement on the server

livid gorge
#

are u saying u should position characters on serverside?

flint estuary
#

there's no other way to do it

#

without doing that, you don't have a movement controller

livid gorge
#

wait gimme 2 secs lemme draw a diagram rq I think it will better explain it

#

1.The server at the lower framerate will place the character AFTER physics so that it stays in place.
2.The client has a larger framerate and it has complete control over their character runs physics calculations for THEIR character.
3.This means the server positioning was useless since it gets immediately overwritten by the clients physics calculation and separates the character and chair so they are not overlapping this results in the ship being pushed slightly since the force is strong since they are inside one another.

flint estuary
#

Well the server owns the ship, not the client. And also client physics still runs at 60fps

#

It's a geometry issue

livid gorge
flint estuary
#

when you set cancollide to false the problem immediately stops

flint estuary
livid gorge
livid gorge
#

lowkey id probs stick to using welds since it means passengers and the driver dont apply forces to it

#

I know u said they dont work but they should

flint estuary
flint estuary
#

Also the CFrame thing here is the best solution. if it ain't broke don't fix

livid gorge
agile rockBOT
#

studio** You are now Level 13! **studio

flint estuary
#

It's not the client trust me

#

If it was, changing the collide wouldn't have fixed the issue inherintly

livid gorge
flint estuary
#

I know how to use welds here, but it's not worth it

#

You'd have to unweld, cframe, weld, every single time someone moves

#

i've used these a lot before it's not worth it. just CFrame the HRP each frame is the way to go

livid gorge
flint estuary
#

I can't

#

if i position the player with local scripts it won't work

livid gorge
flint estuary
#

it relies on the cframe being changed by the server

livid gorge
flint estuary
#

1: why would I bother if it literally works now
2: the entire movement logic is on the server. this can't be on the client side.

livid gorge
flint estuary
#

players can only control inputs

#

they can't tell the server where they want to go

#

only, move forward, or move backward.

#

etc

livid gorge
#

actually they can its why cheaters can play animations and teleport. You would assume the player sends an input to the server and then the server moves the character but it would mean theres a slight delay its why when u set the players character network ownership to the server its jittery

flint estuary
#

you're talking about default movement

#

that's disabled here

#

each frame the player is constantly set on the client and server side to the tgt cframe

livid gorge
#

via netwrok ownership?

flint estuary
#

i didn't add that line so i'd assume the plr has control over the char

#

but it doesn't matter here again...

livid gorge
#

yea then they can move where they want even if the server teleports them

flint estuary
#

even if they change their position locally for a frame, the server corrects it immediately. their local position doesn’t affect the ship because the movement logic runs on the server.

livid gorge
flint estuary
livid gorge
flint estuary
#

dawg

#

who cares

#

i can't lie this is a pointless discussion