MOVING PLATFORM 2D | How to make moving platform in Unity ?

preview_player
Показать описание
How to make Moving Platform 2D in Unity?
In this Unity 2D Tutorial we'll make Moving Platform 2D!
Enjoy the video ☕

————————————————————————————
🖐 Hi Game developer
Welcome to Rehope Games I'm Murat

I share unity tutorial videos on my channel. if you want to make a game with unity (especially 2d platformer game), the videos here will definitely interest you.

————————————————————————————

#unitytutorials, #unity2d, #unity2dplatformer
Рекомендации по теме
Комментарии
Автор

If your character didn’t move smooth on the platform, you can learn the solution in this video 👇👇

RehopeGames
Автор

i have a one way platform that i wanted to make move but i got the result so fast. nice vid and a great and such simplistic way to solve something that has been nerve wracking for me. i just had to set the player's transform be parented by the platform transform. thank you for such a good tutorial.

Nowfen
Автор

doing a Game prototype for my homework, pretty useful, thanks! I changed it a lil' since for some reason it didn't keep the momentum of the platform, anyhow great video !!!!

mrsodaxd
Автор

Whoa I m french and your Tuto is very incridible !

razar
Автор

thank you so much it worked with me when i put onCollisionEnter instead of onTrigger

NPC-tots
Автор

Thank you very much. You helped greatly.

piouslake
Автор

Thanks for a great tutorial! However, I have a small problem. When my player jumps on the platform, he slides down. There must be something wrong with the settings, although the movable platform is set as stationary. This problem only appeared after adding "is trigger". How can I fix it?

aleksandraaleksandra
Автор

thanks, I will try this out, im using it for a slightly different use, a patrolling enemy so I dont need it to be able to ride on the object.

jbot
Автор

my player doesnt have a rigidbody because its a custom player movement script, so the platform moves but my player doesnt become a child of the platform even if i type the code in. Also the code seems to work only when im under the platform for some reason? .please help :)

panagiotiskotsias
Автор

Merhaba. Video için teşekkürler öncelikle. Dediğiniz şekilde yapıyorum fakat a ve b noktalarını koyduğum yerde hareket etmiyor. Üst taraflara doğru hareket edip sanki a ve b noktasını oraya koymuşum gibi orada hareket ediyor. Bunu nasıl düzeltebilirim ?

nihankaraca
Автор

mine just moves to point b and doesnt do anything
here's the script


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Move : MonoBehaviour
{
[SerializeField] private Transform pointA, pointB;
[SerializeField] private float speed;

private Vector2 targetPos;

void Start(){
targetPos = pointB.position;
}

void Update(){
if(Vector2.Distance(transform.position, pointA.position) < 0.1f) targetPos = pointB.position;
if(Vector2.Distance(transform.position, pointB.position) < 0.1f) targetPos = pointA.position;

transform.position = Vector2.MoveTowards(transform.position, targetPos, speed * Time.deltaTime);
}
}


the small changes i've made shouldnt affect the actual script, just the format

food_dev
Автор

what is happening is that for some reason when i enable the "is trigger" checkbox, the platform stops having collision, and the player falls through it. when i land on the platform, it makes the player a child object for a second and then instantly removes it a child object, as the player falls down.

andrexile
Автор

I like this one. But, when im using this code to make a moving platform my player gets hooked up and moves with the platform movement. How can this be ?

brianboddum
Автор

I can’t jump while Iam on the platform pls helpppp

yousfyasser
Автор

when i tried this code to move the object it doesn't loop, it only goes to posB and not returning to posA. What should i do?

rovlag
Автор

My player glitchs and shrinks every time I step on the platform, overall the whole script works

MoneyAK
Автор

my platform for some reason his spawing under my player could you help?

ashitanojoefan
Автор

hello ive run into an issue where my character grows larger and is very slow when on the platform is there any fixes?

SixFlickz
Автор

when i stand on the platform, my character move extrem slowly. any fixes?

emilian_spielt
Автор

Hi, everything works fine, but I get an error if I stop the game while being on the platform: " Cannot set the parent of the GameObject 'Player' while activating or deactivating the parent GameObject 'Platform 1' ". Do you have any ideas how to fix it?

fte