Forum rules - please read before posting.

Draggable on curved track: "UnassignedReferenceException"

edited June 2015 in Technical Q&A
When I set my draggable to a Drag Trac_Curved type and set the "Is looped" on I get this error:
=================================================================
UnassignedReferenceException: The variable maxCollider of Moveable_Drag has not been assigned.
You probably need to assign the maxCollider variable of the Moveable_Drag script in the inspector.
AC.DragTrack.AssignColliders (AC.Moveable_Drag draggable) (at Assets/AdventureCreator/Scripts/Moveable/DragTrack.cs:28)
AC.DragTrack_Curved.Connect (AC.Moveable_Drag draggable) (at Assets/AdventureCreator/Scripts/Moveable/DragTrack_Curved.cs:72)
AC.Moveable_Drag.Start () (at Assets/AdventureCreator/Scripts/Moveable/Moveable_Drag.cs:72)
==================================================================

Any idea if it's a bug or if i'm doing something wrong?
If I set the track to not loop but to a figure like 60 or 200 degrees the draggable does work but I get other errors which aren't related to this one (apparently). I will begin a new thread for those ones.

I'm on Unity 5.1.0f3 and using AC v1.46 (update: checked 1.46a and no different)

Comments

  • Likely a bug.  Open up DragTrack.cs and insert the following into line 28 (the very top of the function):

    if (draggable.minCollider == null || draggable.maxCollider == null) return;

    Does that solve it?
  • By insert I assume to push line 28 to 29 for this.
    I did this and the error doesn't appear any more. Makes sense it was looking for a value the looped option wouldn't have.

    Cheers
  • As this is the same function and may be related I won't start a new thread for a problem I with a Looped Track...

    When I get to the 0 point on the track the draggable leaps off the track.

    I took a video of my screen here:




  • A tough one.  If you can strip everything away in your scene except just the objects needed to demonstrate that, PM it to me and I'll look at it.
  • edited June 2015
    Aha,

    I switched to a looped hinge-track and it doesn't cause the problem.

    For the sake of looking into the actual problem, do you still want to take a look at the project files?

    Also... I didn't know it was possible to send files in forum messages :)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.