Swimming
by Lee-Orr Orbach · in Torque Game Engine · 06/24/2005 (1:52 am) · 3 replies
Hey!!! I wanted to know if someone knows how to make the Starter.FPS player swim in the water, or float?
About the author
#2
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4348
HTH
06/24/2005 (5:26 am)
There is a swimming resourcehttp://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4348
HTH
Torque Owner Luis Anton
// Determine ground contact normal. Only look for contacts if // we can move. VectorF contactNormal; bool jumpSurface = false, runSurface = false; if (!isMounted()) findContact(&runSurface,&jumpSurface,&contactNormal); if (jumpSurface) mJumpSurfaceNormal = contactNormal; [b] //WE SWIM!!! if (mWaterCoverage >= 0.1) { runSurface = true; contactNormal.set(0,0,1); } [/b]All my bots were boats, so they had to 'swim'. Add a varible if you want your players to be able to swim or not. Of course, you will have to add an animation for a swimming model.
And no, that won't addapt to waves ;)