A little late to the party here. Instead of rotating the effector 180 degrees, wouldn't it be better to use a collider mask while down arrow is held? Kind of an edge case, but if you jump while holding down, rather than jumping through it then falling back down through it, you'd bump your head on the platform you can usually jump through. Rigidbody enemies will also fall through the platforms when down is held by rotating the effector.
Another solution for this problem (except of the enemys) is to rotate the effector in a courutine and then wait for a time, for example 0.5 sec. before u rotate it back. If u keep the if-statement thst rotates the effecor if u jump u can get through the platform from downside even before the time of the coroutine runs out. But enemys will still fall through it so its not perfect but quite simple.
Really great tutorial! I didn't know about the effector component. One thing I want to mention, I can see that the tutorials are more targeted to beginners or intended to use Unity out-of-the-box solution. I think that is a great target audience, but as with many out of the box solutions, there might be things that do not instantly work the way you intend them to. For example: This solution only works if there is one player in the game. If there are 2 players, the other player would collide with the platform when jumping up while the other player is dropping down the platform. As I am also making a game with similar mechanics, I just deactivate the collision between a single player and the one way platform when the player is moving up (y velocity > 0) and enable it as the character is moving down (y velocity
Hey :) ! True enough with two players this solution as its problems ! Sounds like a nice solution you came up with though ! Best of luck for your project :)
I have a question/problem. So every time you press the down arrow, the collision will be flipped. When the player has jumped on top of the one way collision platform, and walks on the normal platform and presses down arrow. The collision will be flipped..... and if the player walks on the one way platform he will just fall through it. Any good solution?
Hi c, I realised this also. This will also be a problem if you have prefabs as pressing down on one platform would flip the rotation on all of them. To resolve, I think you need to check that your player on this particular platform and then check if they are pressing down. I did this with an OnTriggerStay2D method private void OnTriggerStay2D(Collider2D other) { if(other.name == "Player") { //Player is on the platform if(CrossPlatformInputManager.GetAxisRaw("Vertical") < 0) { //Player must be pressing down effector.rotationalOffset = 180; } } } The next tricky part is deciding when to return the rotationalOffset back to 0. Either by a wait time or by ensuring the player is no longer in the collider and player is pressing up perhaps (I'm still coding this part :) ) This was a really good video though and despite watching several Udemy courses no one mentioned effectors.
*A few solutions for your concerns or problems you're already facing with your game project* - For anyone concerned with enemies or objects falling: I duplicated the object and changed the Platform Effector>Collider Mask to everything besides the player on the child, and on the parent I did the other way around. Remember to only put your script related to the player on the Game Object related to the collision with the player. -In case you believe that the player will be able to press down and jump at the same time, and getting blocked on the bottom of the platform: Based on the script from the video you can change some parts of that and move it from update to a OnCollisionStay2D, and then adding a condition that compares the Y position of the platform to the player. The player might still face a few problems so, unless you go and find a way of getting the Y position of the player from the bottom, a kinda risky workaround would be to add a -1(or more, it depends on how is your project right now) to the player Y position condition so that the comparison would end up like " playerposition.Y -1 > playformposition.Y" -Instead of using 180 on the Surface Arc, try something like 100, in case you want the player to be able to get on the platform from a diagonal angle. Good luck with your scripts/projects
Guys there is a little problem with the code, and that is it only resets when you press space and for example what if there was 2 platforms under each other, then the player will keep falling, but i fixed it private PlatformEffector2D effector; // For flipping the collider rotation private float buttonHoldTime; //For reseting the platform collider rotation public float rotationResetTime = 0.5f; private bool rotationIsFlipped = false; void Start() { effector = GetComponent(); } void Update() { if (Input.GetKey(KeyCode.S)) { buttonHoldTime -= Time.deltaTime; //We start the timer (while holding the key) which i made small so it seems instant and not when holding if (buttonHoldTime
I did it a bit differently, and it seems to solve a few bugs I was having, namely with ground and ceiling detection from my player and the weird pushing up and down that happens to the player when they pass through the platform. This is how I did it: [RequireComponent(typeof(BoxCollider2D))] public class OneWayPlatform : MonoBehaviour { new BoxCollider2D collider; float top; float timeSinceDropThrough = 1f; void Awake() { collider = GetComponent(); top = transform.position.y + collider.offset.y + collider.size.y * 0.5f; } void Update() { if (GameInput.GetAxis("Vertical") == -1f && GameInput.GetKeyDown("Jump") && Player.Instance.groundCheck.position.y >= top) { collider.isTrigger = true; timeSinceDropThrough = 0f; } else if (Player.Instance.groundCheck.position.y >= top && timeSinceDropThrough > 0.1f) { collider.isTrigger = false; } else { collider.isTrigger = true; } timeSinceDropThrough += Time.deltaTime; } } Hope that helps! If you have any questions feel free to ask.
I liked your delivery of the information. I was looking for this topic, but for 3D, so I couldn't use the information. However, the information was still useful. Thanks for making it.
here's an idea: Give the platform a tag. Check so that whenever the player is colliding with this tag and presses the Down Arrow Key, he waits for half a second, and then his collider is disabled for a quarter second which will cause him to fall. Then enable it a quarter second later (Note that you should probably try experimenting with how long the wait until your collider is re-enabled, as it might cause some bugs in some cases for example the player's collider is re-enabled while he is inside another collider)
You are unbelievable at creating lovely scenes with such simple art. I think one of my favourite things about all your games are their art style. Good job man, great content.
Great video! Unfortunately the method of offsetting the platform effector by 180 degrees is useless since enemies will fall through it as well. Can it be done in a better way?
MonDieu72 I am a beginner but I imagine that it would work if you put two of the same objects except take off the script for falling through the platform
In my case, it works perfectly if I set the waitTime = 0.01 somehow. When I set waitTime = 0.05, the player can not past through the object for the second time. Somehow, it works
Thanks Hasson :) ! That's just to make sure the player doesn't accidentally press the down arrow and straight away go down (which can be a little annoying), instead he as to wait a little (so we're sure he's really wanting to go down). But sure enough it's purely optional :) !
Yay, new series! Could you next do a plataform that desappears after standing on it and reappears after 10 seconds or something? That would be really great
I know this is a little late, but you prolly just need to create a script for the platform, in a parent perhaps, but use the script to detect wether or not the player is standing on the platform via colliders. If he is start a timer and disable the child obj, the platform, after 10 seconds. Then tell it to reappear after 10 seconds the player leaves the collider... or whatever the time frames and conditions you want it to be.
Layer is the correct way if you do this and you set up an enemy in a platform and you hold Down guess what will happen? yes the enemy will go down not only to mention that this is happening on every single platform
the solution work perfectly. but, can you teach me to give timer when player after press down button, timer goes off and turn the collision back to 0? thanks!
if someone got a strange bug where you could not go down the platform the second time it Here is the fixed code using System.Collections; using System.Collections.Generic; using UnityEngine; public class VerticalPlatform : MonoBehaviour { public float waitTime; public PlatformEffector2D effector; void Start() { effector = GetComponent(); } private void Update() { if(Input.GetKeyUp(KeyCode.S)) { waitTime = 0f; //this is where the bug was you had to replace it from 0.5f to 0 } if(Input.GetKeyDown(KeyCode.S)) { if(waitTime
Enemies falling through the platform too? My solution was to apply the script and platform effector to the player I want. This was it changes the player's colliders rather than the whole platform. Note, this lets the player go through ALL colliders though.
Good vid. But, I have a green collider box that wont go away and it seems to block from all sides. Followed the tutorial exactly, but this green box is attached to the new component. Making it impossible to pass through. How do I fix it?
Great video but do you know it there’s a like instead of using keycode down is there a to input it with an axis to a certain direction please keep in mind I’m using the windows version so the d pad is not a separate button at all
As an 8 Bit gamer this going down platform should be hold "down key + jump key" thats the standard. and please use GetButtonDown("Jump") instead of getKeyCode. its universal
Kinda late but, It's not a great solution to the problem: 1. Only works with 2d games, or atleast 2d collisions 2. Is not very scalable, at least this implementation where you have the platform read the player input, this can cause issues It would be best to use layer masks. You'd have 4 layers, grounded and airborne, for the player, and ground and trasnparent, for the terrain. You go into the physics settings and set the grounded layer to collider with both terrains, and the airborne to collide only with ground. Then all you gotta do is change the player's layer acordingly This way when you're grounded the player will collide with everything and you can walk no problem in the transparent objects, but when you're airborne no collision will happen between the player and the transparent objects, you just gotta make sure that you're airbone only on the rise of the jump, not the fall, and you can make the player airborne while holding the down key to fall through the transparent objects. With some ingenuity this can be applied in all sorts of diferent ways to create diverse mechanics, like a shooter where you phase between dimentions to pass through walls and avoid bullets or some other crazy thing.
Hello blackthorn ! I wanted to know if you had any idea what's happening in my pseudo-mini-game. I did everything like you but when I maintain the up arrow pressed, my character sprite seems to be "pushed" up by the vertical platform. Do you have any idea why that happens.. ? Thank you for the tuts, it's great !
I’m getting the error: Assets\scripts\VerticalPlatform.cs(23,26): error CS1061: ‘PlatformEffector2D’ does not contain a definition for ‘rotationaloffset’ and no accessible extension method ‘rotationaloffset’ accepting a first argument of type ‘PlatformEffector2D’ could be found (are you missing a using directive or an assembly reference?)
Got a question. I only want to know when I collide with the top side of the collider. But when I use entercollison2d I get a collision when I go through the bottom on the box collider. Any suggestions?
Heey! Hi Noa xD ! Great Tutorial!! But.. How can i Make this effect to work in just a player? In this case of the video, everything thats are in the colission with platform will faliing down when press ArrowDown :v
Great video, I have used your tutorial and added a platform effector on my tilemap which contains a platform. The thing is that when my character moves down the sprite moves left and right before returning to its normal position. I have added a compositie collider to the tilemap already. Is there a fix for this?
After reading some of the comments I decided to instead just use Physics2D.OverlapCircleAll with the ground check to find the platform(s) that are being stood on, and if it is a one way platform, I used Physics2D.IgnoreCollision with the player's Collider2D to ignore collisions, I set the collisions back to normal once the player's Y velocity is > 0. Decided to post this here just incase anyone else would find this useful. If you have any questions or want the code I used just ask.
and I thought of a trigerr box collider in the bottom of the platoform that disables, the box collider when the player touches it and when you press the down key u disable the box collider again.
If you have several platforms one after another (vertically) the player will fall trough them all. How can you fix so that he fall through the first but hit the next one.
is there any way to use the platform effector for each, individual tile in a tilemap? I'm trying to setup a way to easily plop down tiles that are platforms. So far I have combined the tilemap collider 2d, composite collider 2d, and the platform effector 2d. I expected each tile in the tilemap to have a platform of its own, but in reality the effector 2d generated a single platform for the tilemap which was positioned at the center of the tilemap.
Layer is the correct way if you do this and you set up an enemy in a platform and you hold Down guess what will happen? yes the enemy will go down not only to mention that this is happening on every single platform...
hey BlackThornProd, after watching this video i wanted to try this feature out, and well it works fine when i have to go up through the collider and it also switches after half a second to go down, the thing is that i dont go down even though the half circle clearly shows that the collider turned around, i have to leave the surface of the one way collider and then come back for it to work, any idea why? help is much appriciated!
i follow the code exactly, but nothing happens when I hold down key,. Is there any difference in GetKey, GetButton and GetAxis? Can I use GetKey("Down") instead of GetKey(KeyCode.DownArrow) ?
awsome tutorial thanks. i have a question, when my character stand on a moving platform verticaly, my character shaky and falling! please help me.sorry for my bad english
And more will come :) ! I've been doing the Ludum Dare 41 game jam so expect a behind the scenes vid coming soon, and then back to game dev tutorials !
A little late to the party here. Instead of rotating the effector 180 degrees, wouldn't it be better to use a collider mask while down arrow is held? Kind of an edge case, but if you jump while holding down, rather than jumping through it then falling back down through it, you'd bump your head on the platform you can usually jump through. Rigidbody enemies will also fall through the platforms when down is held by rotating the effector.
It might work, seem logical to me
Another solution for this problem (except of the enemys) is to rotate the effector in a courutine and then wait for a time, for example 0.5 sec. before u rotate it back. If u keep the if-statement thst rotates the effecor if u jump u can get through the platform from downside even before the time of the coroutine runs out. But enemys will still fall through it so its not perfect but quite simple.
Works great
my solution was I applied a platform controller on my PLAYER , so the script changed the players collisions rather than the platforms collisions.
@@Domenic367I can't make IgnoreCollision work so I just change the effector's colliderMask. Anyway better that rotation lmao.
Really great tutorial! I didn't know about the effector component.
One thing I want to mention, I can see that the tutorials are more targeted to beginners or intended to use Unity out-of-the-box solution. I think that is a great target audience, but as with many out of the box solutions, there might be things that do not instantly work the way you intend them to.
For example: This solution only works if there is one player in the game. If there are 2 players, the other player would collide with the platform when jumping up while the other player is dropping down the platform.
As I am also making a game with similar mechanics, I just deactivate the collision between a single player and the one way platform when the player is moving up (y velocity > 0) and enable it as the character is moving down (y velocity
Hey :) ! True enough with two players this solution as its problems ! Sounds like a nice solution you came up with though ! Best of luck for your project :)
Thanks! And also good luck for your channel. Looking forward to the rest of the platformer tutorials.
I have made another solution in case you are interested in checking it out on my page.
I have a question/problem. So every time you press the down arrow, the collision will be flipped. When the player has jumped on top of the one way collision platform, and walks on the normal platform and presses down arrow. The collision will be flipped..... and if the player walks on the one way platform he will just fall through it. Any good solution?
Hi c, I realised this also. This will also be a problem if you have prefabs as pressing down on one platform would flip the rotation on all of them. To resolve, I think you need to check that your player on this particular platform and then check if they are pressing down. I did this with an OnTriggerStay2D method
private void OnTriggerStay2D(Collider2D other) {
if(other.name == "Player") { //Player is on the platform
if(CrossPlatformInputManager.GetAxisRaw("Vertical") < 0) {
//Player must be pressing down
effector.rotationalOffset = 180;
}
}
}
The next tricky part is deciding when to return the rotationalOffset back to 0. Either by a wait time or by ensuring the player is no longer in the collider and player is pressing up perhaps (I'm still coding this part :) )
This was a really good video though and despite watching several Udemy courses no one mentioned effectors.
*A few solutions for your concerns or problems you're already facing with your game project*
- For anyone concerned with enemies or objects falling: I duplicated the object and changed the Platform Effector>Collider Mask to everything besides the player on the child, and on the parent I did the other way around. Remember to only put your script related to the player on the Game Object related to the collision with the player.
-In case you believe that the player will be able to press down and jump at the same time, and getting blocked on the bottom of the platform: Based on the script from the video you can change some parts of that and move it from update to a OnCollisionStay2D, and then adding a condition that compares the Y position of the platform to the player. The player might still face a few problems so, unless you go and find a way of getting the Y position of the player from the bottom, a kinda risky workaround would be to add a -1(or more, it depends on how is your project right now) to the player Y position condition so that the comparison would end up like " playerposition.Y -1 > playformposition.Y"
-Instead of using 180 on the Surface Arc, try something like 100, in case you want the player to be able to get on the platform from a diagonal angle.
Good luck with your scripts/projects
thx bro! But i still have a problem: i have multiple game objects with the same mask above the plataform, and i want to drop only one at a time
Guys there is a little problem with the code, and that is it only resets when you press space and for example what if there was 2 platforms under each other, then the player will keep falling, but i fixed it
private PlatformEffector2D effector;
// For flipping the collider rotation
private float buttonHoldTime;
//For reseting the platform collider rotation
public float rotationResetTime = 0.5f;
private bool rotationIsFlipped = false;
void Start()
{
effector = GetComponent();
}
void Update()
{
if (Input.GetKey(KeyCode.S))
{
buttonHoldTime -= Time.deltaTime; //We start the timer (while holding the key) which i made small so it seems instant and not when holding
if (buttonHoldTime
dude you are the goat
Bro thanks. Yours is even better.
I did it a bit differently, and it seems to solve a few bugs I was having, namely with ground and ceiling detection from my player and the weird pushing up and down that happens to the player when they pass through the platform. This is how I did it:
[RequireComponent(typeof(BoxCollider2D))]
public class OneWayPlatform : MonoBehaviour
{
new BoxCollider2D collider;
float top;
float timeSinceDropThrough = 1f;
void Awake()
{
collider = GetComponent();
top = transform.position.y + collider.offset.y + collider.size.y * 0.5f;
}
void Update()
{
if (GameInput.GetAxis("Vertical") == -1f && GameInput.GetKeyDown("Jump") && Player.Instance.groundCheck.position.y >= top)
{
collider.isTrigger = true;
timeSinceDropThrough = 0f;
}
else if (Player.Instance.groundCheck.position.y >= top && timeSinceDropThrough > 0.1f)
{
collider.isTrigger = false;
}
else
{
collider.isTrigger = true;
}
timeSinceDropThrough += Time.deltaTime;
}
}
Hope that helps! If you have any questions feel free to ask.
I found you yesterday and I am impressed. I like the short videos and all the relevant information. Keep it up! Great work dude
Thanks so much for the support, I'm really glad you like my content !
I liked your delivery of the information. I was looking for this topic, but for 3D, so I couldn't use the information. However, the information was still useful. Thanks for making it.
here's an idea:
Give the platform a tag. Check so that whenever the player is colliding with this tag and presses the Down Arrow Key, he waits for half a second, and then his collider is disabled for a quarter second which will cause him to fall. Then enable it a quarter second later (Note that you should probably try experimenting with how long the wait until your collider is re-enabled, as it might cause some bugs in some cases for example the player's collider is re-enabled while he is inside another collider)
I love your painting style and the 2D coding tutorial
Great one, buddy)
Thanks
Awesome, I did not know about the effector component. Thanks
You are unbelievable at creating lovely scenes with such simple art. I think one of my favourite things about all your games are their art style. Good job man, great content.
Great video! Unfortunately the method of offsetting the platform effector by 180 degrees is useless since enemies will fall through it as well. Can it be done in a better way?
MonDieu72 I am a beginner but I imagine that it would work if you put two of the same objects except take off the script for falling through the platform
You sir, are a fish! A beautiful fish. great video!
this new series looks fascinating! can't wait to see more...
In my case, it works perfectly if I set the waitTime = 0.01 somehow. When I set waitTime = 0.05, the player can not past through the object for the second time. Somehow, it works
So grateful to find this video!! Thank uu
Was wondering how to implement falling down of a platform and you helped a lot with this tutorial
Thanks! This is exactly what I need in my moving platform object!
*coding your own game is easier than you think!*
*You know, you should take this online Unity course on Udemy*
Lol dat add
Thats funny
now THIS is what I needed, a simple, to the point tutorial
thanks for the great tutorial Noa , i did not clearly understand the point of making "WaitTime" i simply ignored it and everything works fine .
Thanks Hasson :) ! That's just to make sure the player doesn't accidentally press the down arrow and straight away go down (which can be a little annoying), instead he as to wait a little (so we're sure he's really wanting to go down). But sure enough it's purely optional :) !
now i got it , thanks Noa
hello from french;
thank you for solution, is very simply and powerfull !!
Great tutorial! I like that you keep them short 😀
Yay, new series! Could you next do a plataform that desappears after standing on it and reappears after 10 seconds or something? That would be really great
That could be a nice little video to add to the series :) ! Thanks for the idea !
I know this is a little late, but you prolly just need to create a script for the platform, in a parent perhaps, but use the script to detect wether or not the player is standing on the platform via colliders. If he is start a timer and disable the child obj, the platform, after 10 seconds. Then tell it to reappear after 10 seconds the player leaves the collider... or whatever the time frames and conditions you want it to be.
So much better than all the raycastings and tags etc one finds on the internet and has no way of implementing as a newbie. Thanks!
Such a beautfull video! Quickly, clear and direct
great video, the way you use the {} symbols hurts my soul but the tutorial was great thanks
i found some other guy going on about layers and things this is much simple ty
Layer is the correct way if you do this and you set up an enemy in a platform and you hold Down guess what will happen? yes the enemy will go down not only to mention that this is happening on every single platform
Thanks, I was in need of this and found this video in one go.
Noa, what about making it so that your player can drop through the platform, but not any enemies that are standing on it?
My new game problem solved ..... Loved the video
short and relevan great bless you buddy
Amazing tutorial my friend!! Exactly all that I needed with very clear instructions. Thank you so much you are my hero!!!
i use this method but the enemy also affected and goes below the platform after i go below the platform by using down arrow key, can anyone help?
the solution work perfectly. but, can you teach me to give timer when player after press down button, timer goes off and turn the collision back to 0? thanks!
I would love to see more animation videos. Like a animation, when the player takes something from the ground.
More animation/art related videos will come out on the channel in the future, you can count on me :) !
YOU ARE THE GOAT BRO! THANK YOU
if someone got a strange bug where you could not go down the platform the second time it
Here is the fixed code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VerticalPlatform : MonoBehaviour
{
public float waitTime;
public PlatformEffector2D effector;
void Start()
{
effector = GetComponent();
}
private void Update()
{
if(Input.GetKeyUp(KeyCode.S))
{
waitTime = 0f; //this is where the bug was you had to replace it from 0.5f to 0
}
if(Input.GetKeyDown(KeyCode.S))
{
if(waitTime
Thank you so much for this video ❤❤❤ now I can complete my pletformer
Cool, but change the rotational offset won't will make the enemy also fall from the platform?
i was searching for this and ya yeet ofc @Blackthornprod got a solution for it
Enemies falling through the platform too? My solution was to apply the script and platform effector to the player I want. This was it changes the player's colliders rather than the whole platform. Note, this lets the player go through ALL colliders though.
Good vid. But, I have a green collider box that wont go away and it seems to block from all sides. Followed the tutorial exactly, but this green box is attached to the new component. Making it impossible to pass through. How do I fix it?
Have you tried ticking the 'Use By effector' box?
Great video but do you know it there’s a like instead of using keycode down is there a to input it with an axis to a certain direction please keep in mind I’m using the windows version so the d pad is not a separate button at all
Could you please do a video on a 2D Shooter please
Thanks love your videos and Great series idea!
A top down 2D shooter will most probably be a series I'll be making in the future :) ! Stay tuned and thanks for the feedback !
Looks so cool. keep up the good work :)
As an 8 Bit gamer this going down platform should be hold "down key + jump key" thats the standard. and please use GetButtonDown("Jump") instead of getKeyCode. its universal
Can you explain further pls!
you're doing a great job! keep it up!
Very nice tutorial 👍👍👍👍👍😘
how can you add this in a tile map collider? and is there a tutorial on how to add different behaviors to a single time map/platform?
Tutorial on using bolt to do this please?
Where can I get the asset for the 2d platform effect and how much does it cost?
Ive been stuck trying to do this with an angle not flat
Awesome tutorial.
Kinda late but, It's not a great solution to the problem:
1. Only works with 2d games, or atleast 2d collisions
2. Is not very scalable, at least this implementation where you have the platform read the player input, this can cause issues
It would be best to use layer masks.
You'd have 4 layers, grounded and airborne, for the player, and ground and trasnparent, for the terrain.
You go into the physics settings and set the grounded layer to collider with both terrains, and the airborne to collide only with ground.
Then all you gotta do is change the player's layer acordingly
This way when you're grounded the player will collide with everything and you can walk no problem in the transparent objects, but when you're airborne no collision will happen between the player and the transparent objects, you just gotta make sure that you're airbone only on the rise of the jump, not the fall, and you can make the player airborne while holding the down key to fall through the transparent objects.
With some ingenuity this can be applied in all sorts of diferent ways to create diverse mechanics, like a shooter where you phase between dimentions to pass through walls and avoid bullets or some other crazy thing.
Maybe late, but just in time for me. :-D Great solution!
@@touzimsky glad i could help
Hello blackthorn ! I wanted to know if you had any idea what's happening in my pseudo-mini-game. I did everything like you but when I maintain the up arrow pressed, my character sprite seems to be "pushed" up by the vertical platform. Do you have any idea why that happens.. ?
Thank you for the tuts, it's great !
You never finished your expectations... Luv the vid tho
I’m getting the error:
Assets\scripts\VerticalPlatform.cs(23,26): error CS1061: ‘PlatformEffector2D’ does not contain a definition for ‘rotationaloffset’ and no accessible extension method ‘rotationaloffset’ accepting a first argument of type ‘PlatformEffector2D’ could be found (are you missing a using directive or an assembly reference?)
Got a question. I only want to know when I collide with the top side of the collider. But when I use entercollison2d I get a collision when I go through the bottom on the box collider. Any suggestions?
Thanks!
Heey! Hi Noa xD ! Great Tutorial!! But.. How can i Make this effect to work in just a player? In this case of the video, everything thats are in the colission with platform will faliing down when press ArrowDown :v
did you find a way to solve that?
@@redwane2431 not yet :v
@@alexandreunity to bad doing my best and can't find this is my facebook lets talk if we can help each other facebook.com/radhouaneouu/
I think that you should creat a layer especially for this player and turn the collider mask into the layer that you creat
@@ahmedbyahmed4405 Can Works xD! But... If you have more than one player in scene?
Hey Hello Man, hey this tutorial its great Thanks a lot, but is there a way to do this using the new tiles system in Unity?
Great video, I have used your tutorial and added a platform effector on my tilemap which contains a platform. The thing is that when my character moves down the sprite moves left and right before returning to its normal position. I have added a compositie collider to the tilemap already. Is there a fix for this?
Thanks for your video .
After reading some of the comments I decided to instead just use Physics2D.OverlapCircleAll with the ground check to find the platform(s) that are being stood on, and if it is a one way platform, I used Physics2D.IgnoreCollision with the player's Collider2D to ignore collisions, I set the collisions back to normal once the player's Y velocity is > 0. Decided to post this here just incase anyone else would find this useful. If you have any questions or want the code I used just ask.
My ladder feels a bit slippery, and the Physics Materials don't seem to do anything, how do I make it so that it's not so slippery?
Could you make a version using the player input system?
and I thought of a trigerr box collider in the bottom of the platoform that disables, the box collider when the player touches it and when you press the down key u disable the box collider again.
If you have several platforms one after another (vertically) the player will fall trough them all. How can you fix so that he fall through the first but hit the next one.
so you will be editing every platform every time you jump ??
is there any way to use the platform effector for each, individual tile in a tilemap? I'm trying to setup a way to easily plop down tiles that are platforms. So far I have combined the tilemap collider 2d, composite collider 2d, and the platform effector 2d. I expected each tile in the tilemap to have a platform of its own, but in reality the effector 2d generated a single platform for the tilemap which was positioned at the center of the tilemap.
Would love an answer for this as well
Layer is the correct way if you do this and you set up an enemy in a platform and you hold Down guess what will happen? yes the enemy will go down not only to mention that this is happening on every single platform...
I know this is a bit old. But I wonder how to make this work with a tile palette and composite collider...
i didnt know it was so simple XD
Nice tutorial, be handy if you provide the assets for beginners, I know theyre very basic and can be created in a few seconds
hey BlackThornProd, after watching this video i wanted to try this feature out, and well it works fine when i have to go up through the collider and it also switches after half a second to go down, the thing is that i dont go down even though the half circle clearly shows that the collider turned around, i have to leave the surface of the one way collider and then come back for it to work, any idea why? help is much appriciated!
Great as always 😄😄 !!
i follow the code exactly, but nothing happens when I hold down key,. Is there any difference in GetKey, GetButton and GetAxis? Can I use GetKey("Down") instead of GetKey(KeyCode.DownArrow) ?
Hi, i was wondering how do u use the platform effector with tilemaps?
Tilemap collider 2 and tick used by effector
I want my player to fall form the platform without sinkin in it first. Just straight phase through when I press the down arrow. Help a brutha out.
Ummm this might seem a little weird but when my character jump through the platform they cant move when they land on the platform. Any tips?
The problem with this, is when you press down and go through the platform you can't jump up through it again.
Thank you
whatif you use this with a 2d fighter? are the players going to keep flipping it on each other?
thanks you
and if i want to place an Platform Effector 2D inside the composite Collider 2D of a tilemap?
awsome tutorial thanks. i have a question, when my character stand on a moving platform verticaly, my character shaky and falling! please help me.sorry for my bad english
Go in your Rigidbody2D component and in there set "Collision Detection" as "Continuous" it will fix that
WE WANT MORE !!!
And more will come :) ! I've been doing the Ludum Dare 41 game jam so expect a behind the scenes vid coming soon, and then back to game dev tutorials !
man, u are like.. God, thx!
I love you guy, thanks
I can get through the terrain from below but i can't fall down from it even though i have the code now, how do i fix this?
does this way working with 3d game
if the 3D game have this kind of platform it will look weird
Can you tell me that how can I use platformeffector2d to pass through the platform and still perform one way jump
thank you so much
How do you get the animated background shown in the video?
I dont want to collide with the platform when I Jump from the side and from below. What can I do?
Thanks a lot :)
how to make moving background as yours?
Anyone else have trouble jumping up smoothly, instead of jumping straight through, it goes to the side or skips frames?
Watch at 1.25speed