Quote: "es, using Sparky's collision dll it's easy. Just cast a ray from the waist of your character down to just below it's feet then using the command "sc_getstaticcollisiony()" you can get the correct height of the ground. I would post a demo showing how it works but you probably don't have Sparky's right now anyway and it's late here.
Here is a link to the topic on Sparky's: http://forum.thegamecreators.com/?m=forum_view&b=5&t=74762&p=0"
So, I downloaded the plugin and saw that it is indeed great, tried to experiment, and - that's weird.
When I create a simple code like that...
oldx#=CamXPos#
oldy#=CamYPos#+2
oldz#=CamZPos#
x#=CamXPos#
y#=CamYPos#-10
z#=CamYPos#
collide=SC_rayCast(0,oldx#,oldy#,oldz#,x#,y#,z#,0)
print collide
It works for the box created earlier, and prints the object number when I'm above it. Perfect. BUT, when I replace it by getterrainheight() and make a function:
function getterrainheight
oldx#=CamXPos#
oldy#=CamYPos#+2
oldz#=CamZPos#
x#=CamXPos#
y#=CamYPos#-10
z#=CamYPos#
collide=SC_rayCast(0,oldx#,oldy#,oldz#,x#,y#,z#,0)
endfunction
It always prints 0.....
Any idea why is this happening?
I tried this for imported .X model too, and it always prints 0 no matter if it's function or not when I use ComplexObject. Why?
edit: I ran some tests, still can't get ComplexObject collision working
I guess it's not the lucky day.