• How to slow down a car on a certain texture?
    3 replies, posted
Hello, I am creating a racing map and was wondering how i could slow down a cars speed when the enter a certain type of texture, when they are off-road of course, or any ways i could tackle this.
lua on the car entity make a[URL="https://wiki.garrysmod.com/page/util/TraceLine"] trace [/URL]going downward every half second or so then get the material of where that trace hits using [URL="https://wiki.garrysmod.com/page/Structures/TraceResult"]traceResult[/URL].HitTexture, then use that to set the speed of the car. This is a coding problem which belongs in the lua forum imo you'll get more help there (ask a mod to move it)
You could alternatively use triggers to do this, but it may have the side effect of causing the car to drift up vertically for a bit.
You could use trigger_vphysics_motion and filters.
Sorry, you need to Log In to post a reply to this thread.