Offset Box Colliders
Hi,
I have screen where I will have several 'modules' of slot car track, which can join together to make different layouts. What I would like to do is to snap the modules together, where the track leaves one module and joins another. The track is not usually in the centre of the module and their may be one, two or three entry/exit points, depending on the module.
So far, I have been able to snap squares and rectangles together but I have two issues:
1) if a module is rotated, then I can't get the module to snap to another module properly. It may jump to the other side of the static module.
2) I can't work out how to shift the module I am placing to the collider on the static module, so that the tracks meet up. I've only managed to get it so that the edges of the module meet up.
The way the modules are set up at the moment is that each module has an 'east' and 'west' collider as children of the module and have an OnTriggerEnter to detect the other collider.
Any clues how I can make the shift, allowing for the fact that the module may be in any one of four orientations?
Happy to send my code, if that helps.
Thanks,
Connal
Your answer
Follow this Question
Related Questions
Rotating Gameobject not Colliding 1 Answer
Need help with walk on the wall and ceiling 0 Answers
How to rotate the object collider with the object? 0 Answers
Collider.size of a rotated object 0 Answers