The game is top down (like how the binding of Isaac is top down) and all the tutorials just say how to do it for a a side scroller like Mario or something. I want W to be up A to be left and D to be right S to be down
3 Answers
3There are lots of way to move your character. You can use transform , rigidbody or character controller for movement.For this code your character should be attatch with rigidbody and it is faster then transform.position
Rigidbody PlayerRigidbody;
void Awake()
{
PlayerRigidbody = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
float h = Input.GetAxisRaw("Horizontal");
float v = Input.GetAxisRaw("Vertical");
Move(h, v);
}
void Move (float h, float v)
{
Movement.Set(h, 0f, v);
Movement = Movement.normalized * 10 * Time.deltaTime;
PlayerRigidbody.MovePosition(transform.position + Movement);
//for transform ( Transform.Translate(new vector3(h,0,v) * 10* time.deltatime) }
`
esiest way
- you need to take an pre-built
character controller !! - there are many projects on internet which are free to download
and have a character controller fully animated and ready to use ( standard assets also have one ) - which jumps moves here and there ohk! and all have W,S,A,D assigned
- and you dont need to put your brain in animation and scripting!
- For top to down you can add a camera which is placed above the character in any angle now put the camera in the character so that, when your character moves the camera also moves !
- so easy! this is the best way to do so
hard way
- if you are a scripter then make your
own scripts take an character from maximo and include all animations - rigid body script
- movement script
- camera script also
- all this you have to make
i recommend using easy way!
@HerdexX
Yes I think you can.
Yep, this is a good example for EditorPrefs as this seems to be a preference of this editor class.
– Bunny83