#movement doesnt follow the direction

1 messages · Page 1 of 1 (latest)

keen jolt
#

i did it before

#

but on this new project

#

it doesnt work

#

here are my 2 script

#

the parent and child relationship

#

the character is the model and rigidbody

#

and both of the script is on the character

surreal sorrel
#
  1. You should not be modifying the velocity of a rigidbody. Use AddForce
  2. It's doing exactly what you told it to do - it's moving along the X axis at a rate of moveHorizontal and the Z axis at a rate of moveVertical. This is in world space
keen jolt
#

ok

keen jolt
#

jsut give me a direction where to change

surreal sorrel
#

Base it on the transform's facing direction (forward/right properties)

keen jolt
#

ok

#

ill see what i can do with it

#

@surreal sorrel

#

will this work

#

or its also the unity editor issue too

surreal sorrel
#

That is one way of doing it

keen jolt
#

it still the same

#

that it doesnt go base on the direction

#

so im not too sure

surreal sorrel
#

You want InverseTransformDirection

#

TransformDirection goes from local to world

#

You want world to local

keen jolt
#

ok

#

calm

#

ok it change the direction , but not the way of the camersa facing.

#

ima try change the camera

#

it shoudl work afte

#

@surreal sorrel it works

#

but on "AddForce"

#

it make the rigidbdoy

#

kinda slide

#

if u get wat i mean