- Home /
Destroy Vectrosity lines
Good day,
I currently have the game creating objects that the user clicks on, however I want to be able to clear the screen at specific intervals. currently I am creating the lines with:
MakeLine = VectorLine.SetLine (Color.white, buttontransform[Positions[z]].position, buttontransform[Positions[z+1]].position);
and removing the lines with
VectorLine.Destroy (ref MakeLine);
The lines create as expected within the program however they never delete.
Any Help would be greatly appreciated!
@Optiknights So, you've pulled this VectorLine class from http://wiki.unity3d.com/index.php?title=VectorLine#VectorLine.cs ? I don't see the function you're using for destroy, so my assumption is that it's actually calling the Destroy function that is a part of $$anonymous$$onoBehvaiour. Have you tried just using Destroy($$anonymous$$akeLine);
?
Andy, in the title it says he's using Vectrosity. Not a random class pulled off the wiki.
@Andy$$anonymous$$artin458 No Vectrosity is a package I imported from the unity store you can find them here: http://www.starscenesoftware.com/vectrosity.html
The documentation they have is only for .js and states:
static function Destroy (ref line : VectorLine) : void
Removes a VectorLine (or VectorPoints) and all associated Unity Objects from the scene. If line is null, its ignored and no null reference exception errors are possible.
Interesting... I put the destroy function immediately after the creation and it destroys instantly. but for some reason when I move to another method or function it does not work. The $$anonymous$$akeLine variable is declared public as well.
I suggest contacting the seller of the asset if his asset is not working correctly.
Answer by gregroberts · Nov 28, 2014 at 06:31 PM
The current docs say that the "ref" argument is only valid for C#.
VectorLine.Destroy (myLine); // JS
VectorLine.Destroy (ref myLine); // C#
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Is there a way to find a Vectrocity VectorLine object at runtime from a script? 2 Answers
Making a bubble level (not a game but work tool) 1 Answer
An OS design issue: File types associated with their appropriate programs 1 Answer