Tutorial 3 (Making a game like beat saber)!

  Рет қаралды 813

SterioMade

SterioMade

4 жыл бұрын

Пікірлер: 3
@mahmouddiaa3165
@mahmouddiaa3165 8 ай бұрын
This is your best vedio, create more plz
@SterioMade
@SterioMade 4 жыл бұрын
Example4 Script using System.Collections; using System.Collections.Generic; using UnityEngine; public class Example4 : MonoBehaviour { public Transform pointA; public Transform pointB; public bool isRight = true; public float speed = 0.3f; private Vector3 pointAPosition; private Vector3 pointBPosition; // Use this for initialization void Start() { pointAPosition = new Vector3(pointA.position.x, 0, 0); pointBPosition = new Vector3(pointB.position.x, 0, 0); } // Update is called once per frame void Update() { Vector3 thisPosition = new Vector3(transform.position.x, 0, 0); if (isRight) { transform.position = Vector3.MoveTowards(transform.position, pointB.position, speed); if (thisPosition.Equals(pointBPosition)) { //Debug.Log ("Position b"); isRight = false; } } else { transform.position = Vector3.MoveTowards(transform.position, pointA.position, speed); if (thisPosition.Equals(pointAPosition)) { //Debug.Log ("Position a"); isRight = true; } } } } ----------------------------------------- DestroyOnClick script using System.Collections; using System.Collections.Generic; using UnityEngine; public class DestroyOnClick : MonoBehaviour { private void OnMouseDown() { if (Input.GetMouseButtonDown(0)) { Destroy(this.gameObject); } } }
@jdtvtunes
@jdtvtunes 2 жыл бұрын
Thank u for the code
Can AI code Beat Saber ? Watch ChatGPT try
8:40
Valem
Рет қаралды 103 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 4,3 МЛН
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 7 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 192 МЛН
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 59 МЛН
World’s Deadliest Laser Maze!
25:59
MrBeast
Рет қаралды 206 МЛН
SAVE & LOAD SYSTEM in Unity
18:20
Brackeys
Рет қаралды 1,1 МЛН
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 719 М.
Unity vs Unreal: Which Engine Should You Choose As A Beginner
14:18
Awesome Tuts - Anyone Can Learn To Make Games
Рет қаралды 934 М.
$456,000 Squid Game In Real Life!
25:42
MrBeast
Рет қаралды 637 МЛН
Can AI code Beat Saber in Unity? Watch ChatGPT try
5:46
why not code?
Рет қаралды 10 М.
MAKING BEAT SABER IN 10 MIN - Unity Challenge
11:34
Valem
Рет қаралды 187 М.
Can AI code Flappy Bird? Watch ChatGPT try
7:26
candlesan
Рет қаралды 9 МЛН
World's Most Dangerous Trap!
19:34
MrBeast
Рет қаралды 242 МЛН
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 7 МЛН