• Creating a trail system with drawbeam?
    5 replies, posted
Would it be possible to create a trail system with drawbeam for the player?
Try to look at pointshop maybe?
in a think hook, every 0.3 seconds or so you could add the player's position and CurTime to a table. then, in a rendering hook, loop through that table and draw a beam connecting the current index and the previous index (if it exists). also, if the stored CurTime of the index is greater than however long you want the segment to last, remove the current index.
[QUOTE=Z0mb1n3;51778682]in a think hook, every 0.3 seconds or so you could add the player's position and CurTime to a table. then, in a rendering hook, loop through that table and draw a beam connecting the current index and the previous index (if it exists). also, if the stored CurTime of the index is greater than however long you want the segment to last, remove the current index.[/QUOTE] I'll try that thanks. [editline]5th February 2017[/editline] [QUOTE=YoutoYokodera;51778612]Try to look at pointshop maybe?[/QUOTE] I'll take a look.
[QUOTE=Metamorphics;51780207]I'll try that thanks. [editline]5th February 2017[/editline] I'll take a look.[/QUOTE] You might rather want to use the function [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/SpriteTrail]util.SpriteTrail[/url], as it is allows for a high degree of control over what the final trail looks like, instead of having to do it manually. It is also an engine defined entity from what I recall, so it probably operates faster than anything you could define in Lua.
[QUOTE=James xX;51780220]You might rather want to use the function [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/SpriteTrail]util.SpriteTrail[/url], as it is allows for a high degree of control over what the final trail looks like, instead of having to do it manually. It is also an engine defined entity from what I recall, so it probably operates faster than anything you could define in Lua.[/QUOTE] The problem with that is I want the trails to be in the same position as bones on the player and util.SpriteTrail only uses attachment points and if I were to use info entities and put those on the players bones and put the trails on the info entities, the trails end up appearing in front of the player. I'm left with the only option of using beams.
Sorry, you need to Log In to post a reply to this thread.