They should get applied - in the FinishMove hook. We don't set the newly calculated values on the entity itself - we instead store them in the movedata. abs( mv: GetUpSpeed() ) < 0.1 ) thenĮnd - Add the velocity to the position (this is the movement). If no keys are down we apply - more resistance so we slow down more. We don't want our velocity to get out of hand so we apply - a little bit of air resistance. Vel = vel + ang: Up() * mv: GetUpSpeed() * speed Vel = vel + ang: Right() * mv: GetSideSpeed() * speed Orbit navigation Move camera: 1-finger drag or Left Mouse Button Pan: 2. Vel = vel + ang: Forward() * mv: GetForwardSpeed() * speed Enables the use of Workshop tauntpacks in A-MTs Prop Hunt gamemode for Garrys Mod. We do that for right and up too, which gives us our free movement. On the first line - we're basically saying get the forward vector, then multiply it - by our forward speed (which will be > 0 if we're holding W, < 0 if we're - holding S and 0 if we're holding neither) - and add that to velocity. ![]() 005 * FrameTime() end - Get information from the movedata - local ang = mv: GetMoveAngles() If ( mv: KeyDown( IN_SPEED ) ) then speed = 0. Set up a speed, go faster if shift is held down - local speed = 0. Add( "Move", "Noclip", function( ply, mv )
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |