![]() 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 Vel = vel + ang: Forward() * mv: GetForwardSpeed() * speed A bug in Prop Hunt is that if you move the mouse around when a hunter is looking right at you, they can sometimes see your player name briefly. 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |