Unity hareket Ettirme
Python
2D projeyi oluşturup güzel bir platform yapın sonra tüm her şeye Box Collider2D Ekleyin Sonra Hareket Ettirmek istediğimiz objeye Rigidbody2D Ekleyin istediğin
2D projeyi oluşturup güzel bir platform yapın
sonra tüm her şeye Box Collider2D Ekleyin
Sonra Hareket Ettirmek istediğimiz objeye Rigidbody2D Ekleyin
istediğiniz rengi ayarlayıp C# Script Açıp şu scirpti ekleyin
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class move : MonoBehaviour{
public Rigidbody2D player;
void Start(){
}
void Update(){
if(Input.GetKey(KeyCode.A)){
player.velocity=Vector2.left*3;
}
if(Input.GetKey(KeyCode.S)){
player.velocity=Vector2.right*3;
}
if(Input.GetKey(KeyCode.X)){
player.velocity=Vector2.up*5;
}
}
}
bu scripti ekledikten sonra Player Yazan Yere Rigidbody2D Yi Sürükleyip bırakın
A ve S Tuşlarıyla Sol Sağ Hareket Edip X Tuşuylan Zıplayabilirsiniz
iyi oyunlarr
Share Your Expertise, Earn Rewards!
Found this insightful? Imagine your knowledge generating income. Contribute your articles to bylge.com and connect with readers while unlocking your earning potential.