Thanks so much bro, thanks to you I’m able to finish my game I’ve been looking for something like this for 2 days
@Osoclever10 ай бұрын
Thank you 😊
@youz123 Жыл бұрын
here's how to do it with tag for those wondering [SerializeField] private Transform player; [SerializeField] private Transform respawnPoint; void OnTriggerEnter2D(Collider2D col) { if(col.tag == "Player") { player.transform.position = respawnPoint.transform.position; } }
@ghostgrimoire27482 жыл бұрын
Thank you very mutch!!
@Firegod81346 ай бұрын
I keep falling through the floor my colliders are on and auto sync transform in on any idea how to fix it.
@NightTimeDevelopments6 ай бұрын
colliders On on both the floor and character
@Firegod81346 ай бұрын
@@NightTimeDevelopments thx
@Nobody153732 жыл бұрын
thxs bro for a short and ez tutorial not like those 1h videos
@NightTimeDevelopments2 жыл бұрын
I know right. I happy to help, just like and sub
@anavpatel7616 Жыл бұрын
TY :D
@_uriah_2 ай бұрын
It doesn't work (My colliders are on...and I followed the tutorial STEP BY STEP and it still doesn't work)
@_uriah_2 ай бұрын
I just used this script instead. It restarts the scene, so it works the same unless you have multiple triggers, then it won't work: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class Respawn : MonoBehaviour { void OnTriggerEnter(Collider player) { SceneManager.LoadScene(SceneManager.GetActiveScene().name); Debug.Log("Scene Restarted"); } }
@NightTimeDevelopments2 ай бұрын
what exactly doesn't work?
@_uriah_2 ай бұрын
@@NightTimeDevelopments So I added a Debug statement and the Debug showed in the console, but then I realized my player would respawn, but the camera would stay down there. It was really confusing and I couldn't figure it out so I reset the scene instead.
@Cole-wb9mu4 ай бұрын
i keep falling through the floor under the respawn
@NightTimeDevelopments4 ай бұрын
Your collider is probably off
@Averagedud316 күн бұрын
the cube is touching your floor
@salaheddine92512 жыл бұрын
Hi, my player just goes trough the trigger and I get the notification "'the variable respawnpoint has not been assigned""
@NightTimeDevelopments2 жыл бұрын
Did you put the script right and plug in a triger that is static
@LotOFfactories Жыл бұрын
I SUB
@megaa9732 жыл бұрын
Is there a way to make it so If i get a certain way through the game the respawn point changes? because mine is an obstical course
@NightTimeDevelopments2 жыл бұрын
yeah
@clocubed52572 жыл бұрын
it works great however if things fall off other than people the respawn platform moves up and down and destroys my map no idea how to fix this
@webpro81082 жыл бұрын
It is because they are all joined in as 1 under the same layer mask
@subabo122 жыл бұрын
@@webpro8108 How do you change the objects layer mask? i tried doing this but i cant figure it out. I dont know what to change on the script.
@webpro81082 жыл бұрын
@@subabo12 it is not the script, it is in the object menu, the video showed that
@Ackvideoadventures2 жыл бұрын
Didn’t work at all it broke my whole game forcing me to restart, and yes I did everything you said!
@thesmartkoala6900 Жыл бұрын
the same thing happened to me too
@funpa2516 Жыл бұрын
@@thesmartkoala6900 i was respawned inside of my ground and once i fixed that part the world didnt render properly. everything worked again when i deleted the script. odd
@pysora62592 жыл бұрын
It doesn't work to me, I just keep falling
@NightTimeDevelopments2 жыл бұрын
The collider is probably not on
@pysora62592 жыл бұрын
@@NightTimeDevelopments I already figured out what was wrong, I needed to activate on project settings "auto sync transform"
@webpro81082 жыл бұрын
@@pysora6259 nice
@ClicksIgloo2 жыл бұрын
Thanks you so much @PySoRa I had the same problem
@bastman-_-2963 Жыл бұрын
@@pysora6259 THANK UUUUUUUUUUUUUUUUUUUUUUU
@bastman-_-2963 Жыл бұрын
i just pass throught the floor
@NightTimeDevelopments Жыл бұрын
your colider is off
@bobbville2 жыл бұрын
This was a major struggle for me in 2d! Like and sub from me! 🔥🔥🔥