Is there a way to remove a player's trail added by [B]util.SpriteTrail[/B]?
Just a simple question. Couldn't find anything helpful on the Wiki.
It returns the trail entity. Just reference it then remove it when you need to.
I have the same problem, but, how can I reference it and then remove it?
[QUOTE=MrAnonymous;23411331]I have the same problem, but, how can I reference it and then remove it?[/QUOTE]
Same. I try redoing it with the different color (alpha 0) but it won't disappear.
When you add a new trail, it piles on top of existing trails.
I think you can do an ents.FindByClass on all the sprite trail ents, and remove it that way though.
[QUOTE=Jo The Shmo;23412771]When you add a new trail, it piles on top of existing trails.
I think you can do an ents.FindByClass on all the sprite trail ents, and remove it that way though.[/QUOTE]
Mmh, but the trail is sprite, how do I get its class?
[lua]
local Player = _R.Player
function Player:GiveTrail()
self.Trail = util.SpriteTrail( --[[ stuff ]] )
end
function Player:RemoveTrail()
SafeRemoveEntity( self.Trail )
end
[/lua]
[QUOTE=raBBish;23413680][lua]
local Player = _R.Player
function Player:GiveTrail()
self.Trail = util.SpriteTrail( --[[ stuff ]] )
end
function Player:RemoveTrail()
SafeRemoveEntity( self.Trail )
end
[/lua][/QUOTE]
I should have thought about that though.. thank you a lot.
Sorry, you need to Log In to post a reply to this thread.