Problem with OnSyncedTriggerEnter2D

Hello,
I have 2D game where I need to indicate collision of two TSBoxCollider2D triggers, but I can't figure out how to do it. I tried to use this line of code from TS Tutorial #3, but it didn't work. :/

public void OnSyncedTriggerEnter(TSCollision other) {}

If you know how to do it, please leave an answer. :#

Best Answer

Answers

  • WheathnWheathn
    edited April 12
    edit: had that reverse. Do
    void OnSyncedTriggerEnter(TSCollision2D col){
    }
  • Hi @Vokyczech, did it work after you try what @Wheathn suggest?
  • Hi,
    sorry @JeffersonHenrique, sorry @Wheathn, huge thanks for reply, I am glad you are pushing me forward ,
    but last month I had a lot things to do in school, so I didn't have any time to reply.
    Unfortunately, problem is still appearing, even after appling of your advice.. For info, I need this script to detect if two objects aren't in each other, because I have a game where, you are building castle and I don't want to allow save of two overlaped objects. Only one thing, that come to my mind as potencional problem is that I have a dragger script for moving of blocks, which are castle made of and the dragger can only move blocks by +0.5 or -0.5 transform position, so maybe the collider isn't able to detect collision if the collide wasn't slow enough?

    For greater chance of detecting the real problem there are some images:

    snap of collided objects: http://imgur.com/9syNltv

    components of object: http://imgur.com/rt7lMfn

    'Intro Coll' important - code: http://imgur.com/Vb2Sh5C

    Thx for further replies.. :)

  • Hi @Vokyczech, do you have two colliders in the same place (overlapping)?
  • VokyczechVokyczech
    edited May 11
    Hi,
    thx for fast reply, there is a video of game objects, which I need to detect collision between:
    https://drive.google.com/file/d/0B31tombwa2THOW9MZElQTWdPMzQ/view?usp=sharing

    As I mentioned before:

    Components of the objects: http://imgur.com/rt7lMfn
    (IntroColl is a game object which provides trigger collider for parent object..)

    IntroColl Script: http://imgur.com/Vb2Sh5C
  • Hey,
    @JeffersonHenrique thx a lot. It's working , if the collide is slow enough.. so, i will change script a little bit and it will be fine. :)
Sign In or Register to comment.