Press Start
Press Start
  • 30
  • 2 349 510
Mario Style Camera Follow Tutorial
In this video I show you how to setup a camera to follow your character like Super Mario World.
SUBSCRIBE: bit.ly/2Js78lE
============
SUPPORT: www.patreon.com/pressstartclub
In this video, we cover:
0:40 - Setting up the scene
1:05 - Explaining how a Mario Camera works
1:42 - Calculating Camera Threshold Boundaries
2:30 - Subtracting by our FollowOffset
3:05 - Drawing Gizmos to outline our threshold box
4:05 - Calculating the distance between our character and the center of the camera
5:35 - Defining the new position for the camera
7:10 - Use Vector3.MoveTowards to move our camera
8:10 - Using RigidBody velocity for camera speed
9:20 - Final Product
COPY & PASTE CODE FROM THIS TUTORIAL:
pressstart.vip/tutorials/2019/11/29/105/mario-2d-camera.html
VIDEO SERIES:
Animation: czcams.com/video/Gqel6Ed4LpY/video.html
Running: czcams.com/video/USLp-4iwNnQ/video.html
Jumping: czcams.com/video/RPdn3r_tqcM/video.html
PERFECT DEVICE ZOOM:
czcams.com/video/3xXlnSetHPM/video.html
MORE TUTORIALS:
pressstart.vip/unity-tutorials
zhlédnutí: 42 116

Video

A Perfect Jump in Unity - A Complete Guide
zhlédnutí 76KPřed 4 lety
In this video we show you how to setup perfect Mario-like jumping in Unity. SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub In this video, we cover: 0:40 - Using a Ground Layer to detect if player is touching the ground 1:23 - Understanding How RayCasts work 2:15 - Applying a Physics2D.Raycast to check for Ground Collision 3:16 - Testing and Tweaking Ground Collision 3:55 - Us...
Super Mario - Running Tutorial in Unity
zhlédnutí 48KPřed 4 lety
In this video to cover running in a 2D environment for Platformer games. SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub PART 1 on Character Animation: czcams.com/video/Gqel6Ed4LpY/video.html In this video, we cover: 0:40 - Adding a RigidBody2D and C# Script 1:24 - Defining Controller Input in C# 2:40 - Moving our Character with RigidBody2D.AddForce 3:35 - Adding Animation Sta...
2D Character Animation in Unity [pt 1 of 4]
zhlédnutí 32KPřed 4 lety
I explain how to draw, animate and setup transitions for your 2D character in Unity. SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub In this video, we cover: 0:35 - How to find spritesheets to reference when drawing 1:30 - Using the right art program to use 2:00 - 3 things to know about how to setup your document 3:38 - Using Aseprite to draw my animations 4:11 - Importing my ...
Dust Effect when Running & Jumping in Unity [Particle Effect]
zhlédnutí 145KPřed 5 lety
In this video we re-create the dust trail effect from games like Super Mario World and Celeste SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub COPY & PASTE CODE FROM THIS TUTORIAL: pressstart.vip/tutorials/2019/09/1/101/dust-trail-effect.html MORE TUTORIALS: pressstart.vip/unity-tutorials TIMESTAMPS: 0:30 - Adding Particle System 1:30 - Setting the position and scale of the pa...
Super Mario Maker 2 - How to Recreate the Key Door in Unity
zhlédnutí 11KPřed 5 lety
In this video I show you how to recreate the key follow and key door effects from the game Super Mario Maker 2 SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub In this video, we cover: 0:25 - Current Scene Setup 1:00 - Setting up the Key Object 1:30 - Installing a Spring Joint 2D component 3:35 - Creating a script for our Key Follow Object 5:00 - Setting up a backpack for our C...
Unity - How To Contain RigidBodies Inside 2D Colliders
zhlédnutí 16KPřed 5 lety
In this video I show you how to hack any 2D collider to allow it to contain objects with RigidBodies. SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub In this video, we cover: 0:00 - Explaining the Problem 1:20 - Theorizing a Solution 2:11 - Testing The Theory 3:45 - The Final Code Used DOWNLOAD THIS RESOURCE: pressstart.vip/resources COPY & PASTE CODE FROM THIS TUTORIAL: press...
Unity - Enemy Follows Player [Beginner Tutorial]
zhlédnutí 185KPřed 5 lety
In this video I show you how to create enemy AI that follows your player around the screen. SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub In this video, we cover: 0:12 - Downloading and importing assets from the asset store 0:30 - Animating and creating our characters 1:10 - Creating a C# script for our Follow Enemy AI script 1:40 - Calculating the direction our player is in...
I MADE A GAME IN 48 HOURS
zhlédnutí 2,8KPřed 5 lety
PLAY FOR FREE: astoldbywaldo.itch.io/death-cruise SUBSCRIBE: bit.ly/2Js78lE Patreon: www.patreon.com/pressstartclub LEARN HOW TO MAKE GAMES LIKE THIS: pressstart.vip/unity-tutorials #unity #scorejam
Death Cruise - Game Jam Trailer
zhlédnutí 1,3KPřed 5 lety
I made this game in 72 hours for #SCOREJAM PLAY IT HERE: astoldbywaldo.itch.io/death-cruise Patreon: www.patreon.com/pressstartclub LEARN HOW TO MAKE GAMES LIKE THIS: pressstart.vip/unity-tutorials
Unity - How to Keep Score
zhlédnutí 36KPřed 5 lety
In this video I am going to show you how to keep track of a players score by showing you how to make a basic game in Unity. SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub In this video, we cover: 0:55 - Adding Colliders and RigidBodies to our objects 1:48 - Downloading resources from PressStart: pressstart.vip/resources 2:15 - Creating a C# script 2:40 - Creating a trigger co...
Unity - Creating a Level Select Screen in C#
zhlédnutí 36KPřed 5 lety
In this video I am going to show you how to create a level manager using only C# code. SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub In this video, we cover: 0:30 - Setting up the scene 0:55 - Creating a Level Button prefab 1:25 - Creating a Placeholder Panel for our Pages 2:02 - Creating a C# script to manage our levels 2:40 - Calculating how many levels fit on a page and h...
Swiping Pages in Unity
zhlédnutí 57KPřed 5 lety
In this video I am going to show you how to swipe between panels. SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub In this video, we cover: 0:45 - Setting up the canvas 1:35 - Creating a new C# script 1:45 - Using Unity's built-in drag event handler 3:00 - Creating a function to move our panel 4:20 - Creating a function to jump between pages 6:35 - Creating an easing effect to ...
2D Perspective Effect with an Orthographic Camera (Parallax)
zhlédnutí 48KPřed 5 lety
In this video I show you how to create a parallax effect with a looping 2D background. SUBSCRIBE: bit.ly/2Js78lE SUPPORT: www.patreon.com/pressstartclub In this video, we cover: 0:25 - Recap of the Background Loop Script 1:40 - Setting up the Z Axis 2:30 - Calculating Parallax Speed 4:25 - Storing our Camera's position 5:15 - Moving our background objects at Parallax Speed 5:25 - Final Product ...
Welcome to Press Start
zhlédnutí 10KPřed 5 lety
Hey, my name is Waldo and I’m a game developer who loves to make videos on game development. I taught myself how to code when I was around 9 years old and I have been doing it almost everyday since. I'm a strong believer that education should be free and that's why I started Press Start and made it publicly accessible for everyone to learn. SUBSCRIBE: bit.ly/2Js78lE
Scrolling Repeating Background in Unity
zhlédnutí 93KPřed 5 lety
Scrolling Repeating Background in Unity
Unity - Point and Shoot Tutorial
zhlédnutí 82KPřed 5 lety
Unity - Point and Shoot Tutorial
Mobile Joystick Movement + Shoot in Unity
zhlédnutí 36KPřed 5 lety
Mobile Joystick Movement Shoot in Unity
Unity - Shooting Enemies with Projectiles
zhlédnutí 36KPřed 5 lety
Unity - Shooting Enemies with Projectiles
Unity - Multiple Touches on Mobile Device [Input.GetTouch]
zhlédnutí 38KPřed 5 lety
Unity - Multiple Touches on Mobile Device [Input.GetTouch]
Unity - Mobile Panning with a Perspective Camera
zhlédnutí 38KPřed 5 lety
Unity - Mobile Panning with a Perspective Camera
Unity - How to Detect Collision in C# [Using Colliders]
zhlédnutí 252KPřed 5 lety
Unity - How to Detect Collision in C# [Using Colliders]
Unity Movement [RigidBody vs Translate]
zhlédnutí 285KPřed 5 lety
Unity Movement [RigidBody vs Translate]
Spawning Objects in Unity [Using Instantiate]
zhlédnutí 240KPřed 5 lety
Spawning Objects in Unity [Using Instantiate]
Unity - How To Save Game / Data [PlayerPrefs]
zhlédnutí 107KPřed 5 lety
Unity - How To Save Game / Data [PlayerPrefs]
Pinch to Zoom and Panning on Mobile in Unity
zhlédnutí 31KPřed 6 lety
Pinch to Zoom and Panning on Mobile in Unity
Unity: Mobile Joystick Tutorial [NO PLUGINS]
zhlédnutí 24KPřed 6 lety
Unity: Mobile Joystick Tutorial [NO PLUGINS]
Unity - Keeping The Player Within Screen Boundaries
zhlédnutí 143KPřed 6 lety
Unity - Keeping The Player Within Screen Boundaries
Understanding Orthographic Size in Unity
zhlédnutí 85KPřed 6 lety
Understanding Orthographic Size in Unity
Working with Time in Unity
zhlédnutí 114KPřed 6 lety
Working with Time in Unity

Komentáře

  • @luciusrex
    @luciusrex Před 18 dny

    i prefer using linear interpolation!

  • @DARK_AMBIGUOUS
    @DARK_AMBIGUOUS Před 29 dny

    It's so useful when you figure out how to make your own tools, it saves so much time. Like I remember I wanted to make something smoothly Lerp from between 2 Vector 3 points and then back over and over again so then I made a script that gets 2 vector 3 positions or 2 empty objects that I can place where I want for point A and B and also has a changeable speed variable in the inspector and you can choose an object you want to move between these points, I made it by making a float variable, then on update, setting it to equal Time.time, then I divide it by another float variable (this will be the speed), then I Modulate it by 2, like this: movingTime = (time.time / speed) % 2; I think it's that. Then then I do movingTime -- ; to subtract one so now it goes from -1 to 1, then I do movingTime = Mathe.Abs, something like that, I can't remember exactly but basically I set the variable to be the Absolute of itself, then I use the movingTime = Mathf.SmoothStep( 0f, 1f, movingTime); to make it smoothly go from 0 to 1 and back to 0, you can also set it so that on start, it gets the distance between point A and B in a straight line and set it to multiply the returned number of the first line of code to that number so now it always moves at the speed you set it to move at, no matter the distance. You can use it for moving floating platforms and stuff

  • @DARK_AMBIGUOUS
    @DARK_AMBIGUOUS Před 29 dny

    It's funny how the red circle just slowly moves upwards until popping out of the ugly grey blob at 2:19

  • @peri3138
    @peri3138 Před měsícem

    4 years later, still great tutorial

  • @sultanrahil3380
    @sultanrahil3380 Před měsícem

    Very Helpful. Thank you

  • @user-fn8wl8de9f
    @user-fn8wl8de9f Před měsícem

    Man, you are best!

  • @r9drigo861
    @r9drigo861 Před měsícem

    NA OEH IUGUAL MARIO CARA

  • @nito8066
    @nito8066 Před 2 měsíci

    i just made a very stupid coding mistake so basicly i made the variabla isgourned false when the player was on the ground

  • @TeurastajaNexus
    @TeurastajaNexus Před 2 měsíci

    Just don't use translate :D

  • @sametayaz4891
    @sametayaz4891 Před 2 měsíci

    2 minutes ago, an AI helper tool suggested me this video. Dude...

  • @EpiccNoobyNotHere
    @EpiccNoobyNotHere Před 2 měsíci

    thanks, rlly helpful.

  • @diegoRAM_
    @diegoRAM_ Před 3 měsíci

    The movements come out the other way around, I move it to the left and it goes to the right, I move it up and it goes down

  • @appleafour-nu5fb
    @appleafour-nu5fb Před 3 měsíci

    The method to convert screen to world coordinates isn’t accurate because it doesn’t work with extreme resolutions like 1080 x 2636

  • @Justeeee115
    @Justeeee115 Před 3 měsíci

    awesome this very helpful and short video

  • @Mballs2478
    @Mballs2478 Před 4 měsíci

    Thank You dear!

  • @irischan3489
    @irischan3489 Před 4 měsíci

    THANK YOU

  • @RuthlessMetalYT
    @RuthlessMetalYT Před 4 měsíci

    does this work? I've tried several other guides but they explain things very bad so I'm not able to follow it.

  • @hambaku7318
    @hambaku7318 Před 5 měsíci

    Dude what the fuck is this black and white with black bg choice? You fucking jumpscared me holy shit.

  • @neverstepd7
    @neverstepd7 Před 5 měsíci

    F0ck... I made a game with .velocity, and already uploaded it. The thing is I wanted to have physical objects actually pushing the character, but I didn't find your video on time.

  • @superdahoho
    @superdahoho Před 5 měsíci

    what if you want the asteroids to behave with collision on some objects but like a trigger with the player?

  • @blog8564
    @blog8564 Před 6 měsíci

    thank you, good man

  • @peterm5187
    @peterm5187 Před 6 měsíci

    I didnt know that PlayerPrefs is non volatile. I always thought the variables in PlayerPrefs will be deleted when closing the game.

  • @user-uz3hr6gf6d
    @user-uz3hr6gf6d Před 7 měsíci

    Try this code at:3:47 Quaternion angle = Quaternion.Euler(direction.y, direction.x,0); rb.rotation = angle;

  • @frestige_
    @frestige_ Před 7 měsíci

    Thank you!

  • @jonathangarciarodriguez1240

    This was such a great tutorial! Thank you so much. I actually made mine in 3D, so I made a few modifications to your script. I'll drop it here in the comments in case anyone wants this result but in 3D :) using System.Collections; using System.Collections.Generic; using UnityEngine; public class multipleTouch : MonoBehaviour { public GameObject circle; public List<touchLocation> touches = new List<touchLocation>(); void Update () { int i = 0; while(i < Input.touchCount){ Touch t = Input.GetTouch(i); if(t.phase == TouchPhase.Began) { Debug.Log("touch began"); touches.Add(new touchLocation(t.fingerId, createCircle(t))); } else if(t.phase == TouchPhase.Ended) { Debug.Log("touch ended"); touchLocation thisTouch = touches.Find(touchLocation => touchLocation.touchId == t.fingerId); Destroy(thisTouch.circle); touches.RemoveAt(touches.IndexOf(thisTouch)); } else if(t.phase == TouchPhase.Moved) { Debug.Log("touch is moving"); touchLocation thisTouch = touches.Find(touchLocation => touchLocation.touchId == t.fingerId); thisTouch.circle.transform.position = getTouchPosition(t.position); } ++i; } } GameObject createCircle(Touch t){ GameObject c = Instantiate(circle) as GameObject; c.name = "Touch" + t.fingerId; c.transform.position = getTouchPosition(t.position); return c; } Vector3 getTouchPosition(Vector2 touchPosition) { return GetComponent<Camera>().ScreenToWorldPoint(new Vector3(touchPosition.x, touchPosition.y, 20f)); } } If you want the circle (or whatever gameobject you have) to be bigger/smaller in the screen, just modify the "20f" in the getTouchPosition method. The other script stays the same though. Hope this helps!

  • @RedDevEg
    @RedDevEg Před 7 měsíci

    Its very good tutorial but does it works with 3D too?

  • @issaelynuma9001
    @issaelynuma9001 Před 7 měsíci

    Why I can use Unity Recorder mysteriously the velocity player is higher than a no record Mode?

  • @palanolho82
    @palanolho82 Před 8 měsíci

    Would you be able to explain why you set the grounZ and not groundX or groundY? many thanks in advance

  • @Ferenc-Racz
    @Ferenc-Racz Před 8 měsíci

    Huge thank you! :) <3

  • @hc9196
    @hc9196 Před 8 měsíci

    I am using the Adventure Creator plugin and this does not work. I suspect something is overriding it. Any idea how to solve this?

  • @MadOliveGaming
    @MadOliveGaming Před 8 měsíci

    I was very confused why this worked for everyone but me. Guess what... my script was not check marked so it was disabled all the time xD. Great video, i have a phone with a weird resolution so i needed this to be able to play my own game lmao

  • @reedw8807
    @reedw8807 Před 8 měsíci

    bro talking like joe pera

  • @topgames9716
    @topgames9716 Před 8 měsíci

    You can achieve the same results with one line of code "Material.SetTextureOffset("_MainTex", new Vector2(loopSpeed * Time.time, 0f));"

  • @DanielLeightonArt
    @DanielLeightonArt Před 8 měsíci

    This and your edge collider hack video really helped solve a problem that had me stuck. Thank you!

  • @tommyholmberg8961
    @tommyholmberg8961 Před 8 měsíci

    Thanks a lot!

  • @PerEffect0
    @PerEffect0 Před 9 měsíci

    where is script?

  • @xRaybeesx
    @xRaybeesx Před 9 měsíci

    I do not understand how rigidbodys work at all there is no clear tutorial on simple movement with them

  • @SpiderDilly
    @SpiderDilly Před 9 měsíci

    If you're having weird issues with snapping back to the first panel, simply move some code (that sets the panel location variable to the new transform.position) into the while loop of the Coroutine worked for me!

  • @SK-R_Games
    @SK-R_Games Před 9 měsíci

    I'm at college so im following along with subtitles. Still such a great tutorial!! Thanks. Also not sure if this was mentioned but remember to unparent your camera to your character.

  • @user-ef7wb2dl7y
    @user-ef7wb2dl7y Před 9 měsíci

    hi i cant find the levels option in background script like in 3:35 in video can someone guide

  • @ilovecode3727
    @ilovecode3727 Před 9 měsíci

    Best🎉

  • @auroth6805
    @auroth6805 Před 9 měsíci

    one of the best game dev channels I've ever seen sad too see you not currently uploading

  • @billybollockhead5628
    @billybollockhead5628 Před 10 měsíci

    Seems like one of my students copied your code here.. But it doesnt work remotely like mario's camera.. And WHY THE HECK are you using Distance functions to calculate x Distance? Wow.. And rigidbody? (facepalm)

  • @jackillmf
    @jackillmf Před 10 měsíci

    Mario moves a bit trickier. But thank you for the idea. :)

  • @narutonamikaze10000
    @narutonamikaze10000 Před 10 měsíci

    Bro where should i place the Creat dust (); because i dont have change direction command in 2d 😢😢 pls tell fast

  • @Madheim777
    @Madheim777 Před 11 měsíci

    you, sir, are the BOSS! ty so much!!!!

  • @EnemyOTS
    @EnemyOTS Před 11 měsíci

    I swear to god I threw your code on the camera and another camera follow code and another parallax code that doesn't repeat the backgrounds and all the sudden I have the smoothest Parallax I've ever done in my life. Thank you for the amazing video. Time to analyse that long ass code to understand wtf is going on :D

  • @willwainwright7166
    @willwainwright7166 Před 11 měsíci

    Still valid today

  • @syu9868
    @syu9868 Před 11 měsíci

    Very brilliant and clearly explained! You saved me at least 2 days.

  • @jaopreto-wlock
    @jaopreto-wlock Před 11 měsíci

    Dude, this video saved me a lot of time, thank u <3