So I’m playing with a prototype I made (ok, it’s actually a beginning-of-development title, but…), and am encountering what I think is a strange issue. My google-fu has failed me on tracking down the cause of this issue over the course of a few hours, so I am turning to you guys for help =D.
I have a scene set up with a script set to “OnTriggerEnter” as the function attached to a pad, that when the trigger is touched, will move a gate along an iTween path (the collider is attached to the edge I want to act as the trigger). This works fine. However, here’s the twist: regardless of collider type used (be it capsule, box, etc. placed to the edge of the object that should fire off the movement event), if the object hitting the collider (this is a ball using a sphere collider) hits at anything OTHER than a straight edge of the trigger collider, it causes the gate to “skip” down for a couple of frames to a location slightly below the path (despite having the object aligned with the path visually for its transform on the pivot point in the editor), then go along the path properly. If the ball hits the collider ON a straight edge, it works 100% fine, no weird skip before the animation plays.
I have been driving myself nuts trying to figure out the “why” of this. I can upload a picture to illustrate if required, but hopefully this is clear enough.
The OnTriggerEnter function does have a check to ensure it’s only been hit once, and not trigger again if it’s hit again by the ball, since it’s meant to be a button-type trigger.
Thanks in advance for any replies!
EDIT: Apparrently it happens regardless just randomly whenever the trigger is used… it isn’t related to the angle at all. I tested this by moving the trigger collider beneath the ball, then having it drop straight down… sometimes it would cause the issue, maybe 7/10 times, while the rest it worked fine. Color me confused!
EDIT upon further testing:
I’m using the iTween Visual Editor along with the Native extension for C#. The position it moves down a bit to isn’t even in anything (it goes down maybe 10 units, using it with RageSpline so 100:1 of normal scale) and then skips back to normal and plays. Apparrently even when playing normally it’s going down a scrap first, despite the center point being aligned with the iTween path’s start point visually (for some reason it’s about 10 units higher than, and 20 units lower than, the actual Position of the gate’s Transform, which I’ve yet to figure out as well).