Player bouncing off steep terrain
by Ian Curtis · in Torque Game Engine Advanced · 08/16/2009 (11:53 am) · 2 replies
Hi guys and gals,
In stock TGEA/AFX 1.8.1 when a player hits a steep terrain it will slide down.
Taken that runSurfaceAngle in PlayerData datablock are set to say 45, and my player is in the air with horizontal velocity, and bumps into a steep terrain (angled at over 45 deg) it will slide down it, which is expected.
Is there a simple way of changing this so that the player bounces off the steep terrain with opposite horizontal velocity rather than just slides down?
I'm aware that I may have to change code in player.cpp, but before I start diving in I just wondered if there was any simpler way I hadn't noticed.
Any advice welcome, thanks.
In stock TGEA/AFX 1.8.1 when a player hits a steep terrain it will slide down.
Taken that runSurfaceAngle in PlayerData datablock are set to say 45, and my player is in the air with horizontal velocity, and bumps into a steep terrain (angled at over 45 deg) it will slide down it, which is expected.
Is there a simple way of changing this so that the player bounces off the steep terrain with opposite horizontal velocity rather than just slides down?
I'm aware that I may have to change code in player.cpp, but before I start diving in I just wondered if there was any simpler way I hadn't noticed.
Any advice welcome, thanks.
About the author
Also known as Woldoc on the MMOKIT forums
Recent Threads
#2
http://www.garagegames.com/community/resources/view/18113
Thanks
08/17/2009 (3:59 am)
thx for the reply Daniel, I tried that, but onCollision doesn't trigger for terrain collisions, I've added a bit of code for it now, and added the code as a resource.http://www.garagegames.com/community/resources/view/18113
Thanks
Torque Owner Daniel Buckmaster
T3D Steering Committee