Move it, GameObject!

Two simple ways to control the position of any GameObject

Cube RigidBody configuration
Looks like an Unfair Pong

Inputs

The Old Input Manager / System
Using GetAxisRaw to avoid Unity’s input smooth filtering… which is not that smooth.

Normalization

Look at that diagonal speed! We don’t want that in our game.
What happens when you normalize.
Three ways to normalize your vectors!
If you have this game in PC, try picking up a turret and move diagonally with a keyboard. You’ll see the difference!

DeltaTime

(No DeltaTime applied) WOW! That’s too fast!
(DeltaTime applied) There! Much better.

transform.position

Fairly simple…
…but, it’s not getting far…
Because transform.position is a Vector3 and our Input is a Vector2, me must cast “moveInput” as a Vector3.
Easy!

transform.Translate()

And it works exactly like “transform.position”.
Uh oh. There’s a bit of jitter going on here…

Conclusion

I am a recently graduated Game Designer with strong knowledge of the Unity Engine! You can check my game “Noise Hunters” on Steam!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store