Hi, I am making a 2d platformer and there are places were you can fall down but sometimes when you fall down you get stuck in the ground. I was wondering if there is a way to make a button to make you teleport upwards a little as I donβt have a restart button and if you did you will have to start from the beginning and that is not that good of an idea so like a button on the keyboard or maybe a button on screen but anyway thank you for the help.
Have you investigated why it falls & gets stuck? If the player isnβt supposed to fall or jump you could clamp the y axis, or if they are meant to jump but not fall below a certain height put a check in that looks at the y position & if it is below a certain point reset it back to where it should be e.g
if (transform.position.y <0) transform.position.y=0;
Or something like that
@tedthebug The character is supposed to jump and fall but if it falls too fast and hits a platform it gets stuck in it btw I am not that old and Iβm only new to unity so please donβt make stuff too complicated but thank you for replying in a short time
@tedthebug also in some cases you are able to get out but i only know that and there are only a few types of that platform that I have in the project
Ok, no worries. Have you done the tutorials? Iβm asking so anyone reading gets an idea of what you know so far.
You need to work out why he is getting stuck. Iβm assuming you are using a bool to determine if he is grounded so you know if he can jump. If thatβs the case thereβs a chance that the collision with the platform/hole isnβt setting the bool so it thinks he is still in the air.
Do you know how to debug & check what is being passed?
I am currently using the character that unity comes with in the 2d package and also when he gets stuck it looks like he is falling btw I canβt use unity currently
Ok. Iβd recommend that you park your own game for a while & do the tutorials as they will explain how it all works & get you used to unity. You donβt want to start with your own game while you are learning because you will get frustrated that it doesnβt work the way you want it to.
http://unity3d.com/learn/tutorials
Start with roll a ball then do space shooter. When you are confident you will be able to come back & look at what youβve done & you will probably be able to sort it out.
At a guess Iβd suggest you have an issue with the colliders on your character & platforms.
Thank you for the support @tedthebug
Good luck
Click on your character, then from the inspector select RigidBody2D and make sure Collision Detection is set to Continuous
Thank you @skinwalker_1 it helped a lot
ββ( Ν‘Β° ΝΚ Ν‘Β°)ββ
ββ(βββ)ββ
ββ(βββ)ββ
.ββ(βββ)ββ
β¦ββ(βββ)ββ
β¦ββ(βββ)ββ
β¦ββ(βββ)ββ
β¦ββ(βββ)ββ
.ββ(βββ)ββ
ββ(βββ)ββ
.ββ(βββ)ββ
β¦ββ(βββ)ββ
β¦ββ(βββ)ββ
β¦ββ(βββ)ββ
β¦β¦β(βββ)β
β¦β¦β(ββ)β
β¦β¦β¦(β)
β¦β¦β¦.*