Search Unity

How to Changue OneWay Direction in Platform Effector 2D

Discussion in '2D' started by lavz24, Mar 4, 2015.

  1. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    Hi,

    I saw in the new Unity5, a componennt called PlatformEfffector2D. I want to know if its posibble changue the direction for activate OneWay?? Right now the oneway only activate if I go up, If i want a down oneway how it could be?

    Thank all
     
  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    899
    Just rotate the object it's attached to 180 degrees.
     
  3. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    I will try,

    thank you
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,455
    Rotating it should indeed work as it's local "up". It would be possible to have that as an option should it be a common requirement; it's something I never really thought would be useful.
     
    awesomedata and theANMATOR2b like this.
  5. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    In OneWay Paltform You can go up but in some games you wanna down too. For example: With Jump Go up inside the oneway platform and then I press down and i go down inside platform.

    And I note, if I go up inside oneway but i dont reach the up of platform, the physic system move my character to a side and not let me down again.
     
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,455
    This was fixed a while ago but for QA reason, couldn't go into the final release candidates therefore it was put into the first patch release. That issue should be fixed when that is release fairly soon.
     
    lavz24 likes this.
  7. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    Thanks, if you resolve the Oneway with any direction I use it :)
     
  8. SoulRider

    SoulRider

    Joined:
    Apr 11, 2015
    Posts:
    7
    Any update on when this will be added, I need side-side one way collision, and having to rotate objects in code all the time is a pain :D

    Also, this doesn't 'ignore collision' as such. I have a piece of code that runs OnCollisionEnter, and it runs even when the object is hit from the 'ignored' side.

    How can I ignore all collision events, such that no code runs on a reverse trigger entry?
     
    Last edited: Dec 29, 2015
  9. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,455
    Why do you need to rotate 'objects' in code? Can you not do that in the editor?

    The feature is on an internal list but unfortunately it hasn't been implemented nor do I have a date when it will.
     
  10. SoulRider

    SoulRider

    Joined:
    Apr 11, 2015
    Posts:
    7
    Unfortunately the objects are placed dynamically during the game and need to be flipped as neccesary to be the right way round.

    Specifically making the buildable stairs in a lemmings type game, but with different planes, so can be built off walls etc as well.
     
  11. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,455
    I see, yes, that's a good use-case.

    In the notes I wrote at the time, I added the concept of an angular offset that would apply to both the surface and sides together without the need to rotate the actual effector-colliders.

    It's actually a pretty simple change; I'll stick it on the list of things that can be done in Jan 2016. That's about the best I can do for now.
     
  12. SoulRider

    SoulRider

    Joined:
    Apr 11, 2015
    Posts:
    7
    Thats great. I am using a trigger to ignore collision on the back side of the stairs at the moment. It does the job, but it would definitely be easier with the effector. If it goes in, great, it's not a must have feature, but certainly a useful one.
     
  13. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,455
    Just a heads-up to say that I've added a rotational offset to the PlatformEffector2D but I've still got to modify the gizmos to show that to finish the work. I can;t say exactly when this will land but I'll get it in ASAP.
     
  14. Hoshio

    Hoshio

    Joined:
    May 25, 2014
    Posts:
    4
    Hi ! Is there any news about the implementation of the rotational offset for the PlatformEffector2D ?
     
  15. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,455
    I've implemented it and it'll go into review then onto the release stream soon however I cannot give you an exact release date for it.

    Here's a video of it in action.
     
  16. Hoshio

    Hoshio

    Joined:
    May 25, 2014
    Posts:
    4
    Amazing ! Thank you very much :).
     
  17. st33d

    st33d

    Joined:
    Jan 22, 2014
    Posts:
    28
    Still not live then?

    This is not good news for me as I have to refactor a load of code and make everything extra complicated so I can have a one way surface.

    One way surfaces are actually incredibly common in platformers. They allow you to force the player to backtrack without punishing them with the negative feedback of dying. I've implemented many one-way systems in a lot of platformers I've programmed to create maze puzzles and tutorials.

    I'm very disappointed to have to add yet another hack to my code. This makes everything take longer to develop.
     
  18. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,455
    It was added to 5.5 early in the alpha cycle as that was the next version that still had its feature window open. It was also included in the 2D Experimental Preview #1 a fair while ago. Preview #2 is out soon.
     
    Last edited: Aug 17, 2016