#Velocity

1 messages · Page 1 of 1 (latest)

lone swallow
#

Could you add a log next to the add force that prints out moveForce? Also make sure that a second script isn’t the one that’s moving the character

#

@modern vine

modern vine
#

yes they seem alr

#

i printed move force here

#

and tbh they must be alr, because otherwise how is player moving

#

player moves fine in x and z

#

can even jump

#

but for some reason, velocity x and Z never changes

#

but the Y does change

lone swallow
#

under the add force

modern vine
#

ok

#

is unity bugged or smth ahah

#

this is me jumping

#

(the force printed is to do with x and z movement)

#

some other force else where in code is doign the Y

#

but thats just to show

#

Y velocity changes

#

but X AND Z never does

lone swallow
#

actually yes that is very weird

modern vine
#

is this a bug or something

#

lmao

#

how will i find a work around to this? i need to find out the speed of player

#

lmaoooo

#

well tbh i also need velocity to know players direction

lone swallow
modern vine
#

its quite important

#

bruh nahh yea i dont wanna do that

#

is it uncommon to move player by adding force?

#

how do most people move player?

lone swallow
#

No it’s a pretty common to do it

#

I personally like having full control over the player’s movement and change its velocity instead but both work

modern vine
#

its annoying coz my previous code did change velocity directly

#

but i recently changed it

lone swallow
# modern vine

Could you change it to ForceMode.Acceleration instead of .Force. It shouldn’t fix it, but I’m curious if it changes anything

modern vine
#

ok

#

no

lone swallow
#

thought so

modern vine
#

that is confusing tho, how does impulse change velocity.. hmmm hmm

#

but the force doesnt

#

forcemode.impulse changes the Y velocity

#

but forcemode.force dont work

modern vine
#

yes but why is unity saying velocity never changes

#

in physics analysis

#

debugger

#

well not only in the debugger, but rigid body as aw hole

#

can't even determine where the player is moving

#

and how fast

lone swallow
modern vine
#

one thing i havent tried

#

is restarting unity

lone swallow
#

Remember to save first

modern vine
#

ye

#

i hope to god

#

this fixes it

#

nope...

#

wait

#

could the aniamtor influence it?

lone swallow
#

yes

modern vine
#

for some reason when my avatar had some weird animation

lone swallow
#

it can, I was just about to bring that up

modern vine
#

THE X AND Z seemed to have changed

#

velocity

#

why the fuck did the animator affect my velocity wow

#

lol

lone swallow
# modern vine

although I don’t know if can affect velocity. Disable root motion and/or the component and see if it changes anything

modern vine
#

alr

#

who on earth came up with the idea that animations affect velocity

#

lmao

#

omg its working

#

and all of a sudden

#

im going supperrrrr fast

lone swallow
#

I knew that root motion could affect a moving object, but I’ve never seen it affect a rigidbody before. That’s interesting

modern vine
#

thats gotta be a bug or smth LMAO

#

because i were still moving

#

and velocity was 0?

#

like what

lone swallow
modern vine
#

interesting...

#

so when i overrided the velocity

#

it basically took over

#

whatever the animator was tryna do to it

#

oh well so we solved it! thanks for the help lol

#

im gonna have to do some adjusting to my players speed now

#

coz for some reason after disbaling root motion

#

the player speeeeds realy fast