#Velocity discussion

1 messages · Page 1 of 1 (latest)

young spruce
slim swallow
#

Yeah

#

rb

still cave
#

ok so then in update, you do rb.velocity = new Vector3(Xinput,rb.velocity.y,Zinput);

slim swallow
#

The void Update() thingy

still cave
#

yes

slim swallow
#

Also

#

Its vector2

#

Its a 2d game

still cave
#

oh

#

hold on

#

ok so im just gonna give you the instructions all over again

slim swallow
#

Ok

still cave
#

first declare float Xinput; and float Yinput; before the start method, add Xinput = Input.getAxis("Horizontal"); and below that Yinput = Input.getAxis("Vertical"); inside update. than inside update add rb.velocity = new Vector2(Xinput,Yinput);

#

actually your also goin to want to add a speed variable to adjust your characters speed. so before start declare: float speed; than in update instead of rb.velocity = new Vector2(Xinput,Yinput); do rb.velocity = new Vector2(Xinput*speed,Yinput*speed);

#

got it?

#

if none of this makes sense than just look up a tutorial on 2d movement in unity

slim swallow
#

I wont torture you

#

I will screenshot it

#

But i dont get ut

#

Im bad at csharp

#

But i appreciate your time to help

still cave
#

how long have you been doing unity?

slim swallow
#

Well

#

I already made a simple game

#

Maybe 2 months

#

Or 1

#

When it comes to csharp coding i just look up tutorials i dont know anything

still cave
#

i suggest you watch more unity tutorials before starting your next game, look up some tutorial on 2d movement in unity

slim swallow
#

Ok

still cave
#

they arent very long

slim swallow
#

Wait

#

You mean