Steve_Yorkshire Posted February 16, 2018 Share Posted February 16, 2018 Setting PlayerData runSurfaceAngle to 90 or more in the Player's datablock means that the "Fall" flag never set, so the player can only go upwards or walks in the air.This is actually logical, as the test for player contact is directly vertical to the playerObject and >89 degrees is horizontal. So if the player runs up a steep slope and then steps off into thin air, they stay hovering and can never move back downwards. Obviously this should simply be avoided by using sensible values in the datablock, but just incase for those of us who might make a mistake (*cough* it only took me days to work out what the issue which I was having was :oops: ) it might be an idea to add a little safety check to the code.Engine/source/T3D/Player.ccpbool PlayerData::preload(bool server, String &errorStr) { if(!Parent::preload(server, errorStr)) return false; //... if (runSurfaceAngle > 89)//yorks safety first { runSurfaceAngle = 89; Con::warnf(ConsoleLogEntry::General, "PlayerData::preload: runSurfaceAngle exceeds 90 degrees. Resetting to 89 degrees."); }//yorks end safety first runSurfaceCos = mCos(mDegToRad(runSurfaceAngle)); jumpSurfaceCos = mCos(mDegToRad(jumpSurfaceAngle)); if (minJumpEnergy < jumpEnergyDrain) minJumpEnergy = jumpEnergyDrain; // Jetting //... Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted February 17, 2018 Share Posted February 17, 2018 Thanks Steve. Though I doubt this will affect me, it's good to know. Who now's maybe if someone was trying to implement parkour or the scene at the end of Doctor Strange. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.