Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
using UnityEngine; public class PlayerMove : MonoBehaviour { public float speed; public float jumpPower; public Rigidbody2D controller; private float x; void Update() { x = Input.GetAxis("Horizontal"); if (x > 0) { transform.rotation = Quaternion.Euler(0, 0, 0); // поворот направо } if (x < 0) { transform.rotation = Quaternion.Euler(0, 180, 0); // поворот наліво } if (Input.GetButtonDown("Jump")) { controller.velocity = new Vector2(controller.velocity.x, jumpPower); } } void FixedUpdate() { controller.velocity = new Vector2(x * speed, controller.velocity.y); // рух по горизонталі } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)