Camera Follow

Camera Follow

Camera Follow using UnityEngine; using System.Collections; public class CameraFollow : MonoBehaviour { public GameObject player; // Public variable som bruges til reference til spilleren. private Vector3 offset; // Offset bruger vi til at gemme forskellen mellem...
Car movement 2D

Car movement 2D

Car movement 2D using System.Collections; using System.Collections.Generic; using UnityEngine; public class Carmovement2D : MonoBehaviour { public float CarSpeed = 400; public float RotateSpeed = 20; public Rigidbody2D CarRigidbody; void Update() { // Den skal rotere...
Sidescroller movement 2D

Sidescroller movement 2D

Hvordan får du en figur til at bevæge sig og hoppe som i en 2D sidescroller? using UnityEngine; using System.Collections; public class TopDownMovement2D : MonoBehaviour { public KeyCode ButtonLeft = KeyCode.LeftArrow; public KeyCode ButtonRight = KeyCode.RightArrow;...
Topdown movement 2D

Topdown movement 2D

Topdown 2D Movement  using UnityEngine; using System.Collections; public class TopDownMovement2D : MonoBehaviour { public KeyCode ButtonLeft = KeyCode.LeftArrow; public KeyCode ButtonRight = KeyCode.RightArrow; public KeyCode ButtonUp = KeyCode.UpArrow; public KeyCode...