Answer the question
In order to leave comments, you need to log in
How to prototype app design?
I understand that the question is quite general, but:
- What is worth reading on this topic?
- In what programs do you usually sketch application design prototypes? (is it just photoshop, or something more specific?)
Answer the question
In order to leave comments, you need to log in
You have some confusion in the structure of the code.
The FixedUpdate and Jump functions are outside the class, the last curly brace is generally superfluous.
something like this
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Управление : MonoBehaviour
{
Rigidbody2D rb;
Animator anim;
void Start()
{
rb = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
}
if (Input.GetAxis("Horizontal") == 0)
{
anim.SetInteger("stay", 1);
}
else
{
Flip();
anim.SetInteger("stay", 2);
}
}
void Flip()
{
if (Input.GetAxis("Horizontal") < 0)
transform.localRotation = Quaternion.Euler(0, 0, 0);
if (Input.GetAxis("Horizontal") > 0)
transform.localRotation = Quaternion.Euler(0, 180, 0);
}
void FixedUpdate()
{
rb.velocity = new Vector2(Input.GetAxis("Horizontal") * 12f, rb.velocity.y);
}
void jump()
{
rb.AddForce(transform.up * 14f, ForceMode2D.Impulse);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question