Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

CapsuleCast issues

Discussion in 'PSM' started by KazooieFan, May 28, 2014.

  1. KazooieFan

    KazooieFan

    Joined:
    Nov 21, 2013
    Posts:
    5
    I finally got around to trying to put my work in progress on the Vita with the PSM version of Unity. While things work relatively well when run inside Unity, odd things are happening when I build it and run it on the Vita.

    I traced the biggest issues I'm having to CapsuleCast commands. For whatever reason I am getting successful CapsuleCasts when I shouldn't. After some debugging, I see the hit.transform that is supposedly hit is nowhere near the character (not even in the same direction of the casts) and the hit.distance is being returned as NaN (which to me seems should be a positive number if a transform is being hit)

    Is anyone else experiencing anything similar?
     
  2. KazooieFan

    KazooieFan

    Joined:
    Nov 21, 2013
    Posts:
    5
    I've been deleting/disabling parts of my game and rebuilding to the Vita to try to figure out exactly what is causing the issue. I narrowed it down to the character controller on the enemies. If I take the character controllers off all the enemies then everything functions as expected, but when I leave them on I get hits from the casts almost every time (even when the cast is in a different direction than any of the enemies).

    Still unsure if this is a bug or something I'm doing wrong, but I guess it's progress.
     
  3. KazooieFan

    KazooieFan

    Joined:
    Nov 21, 2013
    Posts:
    5
    Well, I wasn't able to pinpoint the exact situation where I was getting the false positives for CapsuleCasts on the Vita (it happens often, but seems completely random) though I came up with a workaround. I have an extra check in my code where if float.isNaN(hit,distance) then I disregarded the positive result of the cast.

    I'd rather know what I am doing wrong (or if it is truly a bug), but I've spent way too much time on this, so I am just glad I can finally move on.
     
  4. PeterD

    PeterD

    Joined:
    Feb 6, 2013
    Posts:
    120
    I haven't experienced tis myself but, if your code is working correctly in the editor then it sounds like a bug in the vita implementation of capsulecast to me.
     
  5. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    Any chance we can get a small repro of the issue your seeing? Just report it as a bug, and attach the project.

    Thanks.