#How would I set up a base for a Character Controller appropriately?

1 messages · Page 1 of 1 (latest)

versed hazel
#

I'm a novice scripter, but I do have experience in other engines such as LÖVE and Godot. I'm making an entirely custom movement system that directly manipulates momentum values using AssemblyLinearVelocity, and porting code from another game (Sonic Robo Blast 2) to do so.

The thing is: The base I set up is pretty shit. I add in the collider after deleting all parts of the player, then turn EvaluateStateMachine off, make the collider completely unrotatable and weld a rig to it.

This causes the player to be unable to reset whatsoever, and when I try to rotate the rig, it jitters and eventually forces itself back to work it was. I can't show code, as I'm not on PC right now, but I used constraints, and VectorForce to stop the game from applies it's gravity to the player.

Is there any examples I can look at for adding capsules instead of the usual avatar? Along with that, how can I attach a rig to my collider, but still have it able to be rotated to my needs?

#

Bonus points if we can attach the avatar to the capsule instead. That was my original idea, but it didn't work.

versed hazel
red chasm
#

if it were me i'll just use a startercharacter

#

get roblox physics

versed hazel
versed hazel
sharp driftBOT
#

studio** You are now Level 1! **studio

versed hazel
#

not what i want

meager nacelle
#

R u referring to a primary part

versed hazel
#

i want the player to be the collider

#

but i want the rig to also move alongside the collider yet be able to rotate freely

#

and not collide with anything ofc

versed hazel
#

i have a solution in mind for player rigs

#

characters would be moved to their own folder in workspace called Players

#

rigs would be named after the players and slapped into their own folder named Rigs

red chasm
#

prolly use raycasting more

#

it'll cause lag tho

versed hazel
#

its a bit weird of a solution but it worjs

#

roblox really should provide a inhouse solution for this thing...

red chasm
#

np

versed hazel
#

UPDATE:

apparently this is so hacky to the point where it doesnt replicate right to the server

i need help with this, tons of it

first of all, i wanna take a different approach and make my rig replace startercharacter entirely. one problem; i dont know i can make the root part only rotate on 1 axis while the other parts can rotate as much as they want freely. this was the reason why i did the method i did

sharp driftBOT
#

studio** You are now Level 2! **studio

versed hazel
sage grove
sage grove
versed hazel
#

specifically the rigs primary part

#

along with this the player isnt able to reset at all so i need a better method

sage grove
#

Ur doing velocity on the client right?

versed hazel
sage grove
#

can I see a vid

versed hazel
#

im on mobile rn so i cant show

sage grove
#

also what parts are u doing on the server (if u are)

versed hazel
#

on pc i do havw a video of the server/other player falling thru the dloor

sage grove
versed hazel
versed hazel
versed hazel
# sage grove Wym

the rig falls through the ground for any player except yours (your client), while the collider itself stays where it should be which is the players position

#

a heartbeat function feels like more of a hack than an actual fix

sage grove
versed hazel
#

and i dont wanna risk that as i wanna use this engine for my own games

sage grove
#

heartbeat runs every time after physics

versed hazel
#

so does stepped doesnt it?

sage grove
#

and raycast are cheap they won’t cause lag

sage grove
#

and ur not doing ur movement on the server

versed hazel
#

wait so let me get this straight

#

if i use stepped on the client

#

it runs when the server runs physics?

sage grove
#

stepped doesn’t work on the client

versed hazel
#

but i use stepped on the client

sage grove
#

heartbeat is what runs after physics

versed hazel
#

and it works

sage grove
versed hazel
sage grove
#

Unless u mean renderstepped

versed hazel
#

no i use both

sage grove
#

Or PreRender

#

??

#

Stepped doesn’t even work on the client tho

versed hazel
#

renderstepped is what i use for rig positioning

sage grove
#

Lms ur code

versed hazel
#

stepped is for general physics updates

versed hazel
#

im on mobile

sage grove
versed hazel
#

ah whatever

#

if i could have used the pc at this time i would have shown

sage grove
versed hazel
#

ohhh shit i see now

sage grove
#

Anyways id say do a raycast every heartbeat to detect collisions

versed hazel
#

so i gotta do BOTH

versed hazel
#

its just the rig being stupid

sage grove
#

What’s ur problem

versed hazel
#

the rig has gravity applied to it and falls through the floor even tho i make it so theres no velocity on it and set its position to my collider every frame in RenderStepped

#

if i run that same code in both RenderStepped and Stepped then itll work i hope

sage grove
#

U can check if it’s grounded when applying gravitational force

versed hazel
#

the rig doesnt go through any of that, the collider does

#

its just a visual for the player

#

the collider works as intended but not the rig

sage grove
#

Ok so to be clear ur colliders position isn’t updating properly but ur rig is?

versed hazel
sharp driftBOT
#

studio** You are now Level 3! **studio

versed hazel
#

my rig just falls through the ground

sage grove
#

U should properly do ur collision logic before u do velocity

versed hazel
#

but if i put the rig updating code in Stepped, my rig sorta lags behind

sage grove
versed hazel
sage grove
versed hazel
#

ill update the rig in both stepped and renderstepped then

versed hazel
# sage grove No

i already stated that i dont wanna do stepped only because the rig sorta lags behind

sage grove
versed hazel
sage grove
#

Velocity should be handled before physics

versed hazel
#

oh so then just Stepped should be fine

red chasm
red chasm
sage grove
red chasm
#

and if you do it consistently

#

so uh

#

preferably dont do it

sage grove
#

Raycasts are cheap

red chasm
#

yes

#

it doesnt mean you can use it if theres better way

#

so stop

#

replying ot my msg 💔

sage grove
red chasm
#

crazy

#

s1 skid?

#

do you know how easy it is to get s1

#

road to s2 gngs

sharp driftBOT
red chasm
#

oh sht

versed hazel
#

ok so like

#

im trying to use StarterCharacter now

#

and i have this NEWrig

#

im trying to turn the root part into the hitbox for the player

#

anyone know a solution? i can use blender

crystal condor
#

what even is problem

versed hazel
#

nevermind

#

i fixed it 😭

crystal condor
#

you're welcome salute

red chasm
sage grove
red chasm
#

Send a script that create a.base part and parent it to the workspace in a loop

#

We'll see what happens

red chasm
#

what is medal