Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Triomferus · Oct 15, 2011 at 04:40 AM · animationcollidertriggeritweenpath

An odd iTween+RageSpline animation issue with trigger/collider!

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).

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Triomferus · Oct 16, 2011 at 07:31 PM

I figured it out... through a bunch of fiddling, apparrently my code was fine. The issue was also unrelated to iTween or RageSpline, but rather how I set up the scene in Unity. After making a new object to test the code with, and having it work fine through many different ways of triggering it, I then tried re-creating the same original glitched object to attach to these triggers and noticed when adding components, the old one had a RigidBody attached. I immediately tried removing the RigidBody from the glitched object and it works perfectly now 100% of the time.

The reason it was sometimes showing as glitching down then snapping to the path was, I am hypothesizing, due to the framerate and timing of the physics fixed time-steps. Sometimes the time-step would miss the frame the pathing triggered in, and by the next frame it already was locked to the iTween path.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

How do I make the enemy ai animations play after the player exit the on trigger collider on the enemy ai 0 Answers

Having a door dissapear once a key is collected 1 Answer

Is it possible to generate a Path from iTween? 2 Answers

Animation affects only collider, not the object 1 Answer

Collide with object trigger - why animation only occurs on first encounter with trigger 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges