I have bin trying this to work ok in agk and no luck
Works great on walls but cant climb small stairs ok?
So i ended up with this and its no good and uses to much resources.
This can walk up and down stairs but is buggy on corners.
rem Old position
oldx#=GetCameraX(1)
oldy#=GetCameraY(1)
oldz#=GetCameraZ(1)
rem Move camera
if GetRawKeyState(38)=1 or getvirtualjoysticky(1)<0.0-0.5 then MoveCameraLocalZ(1,moveSpeed#*GFT#)
if GetRawKeyState(40)=1 or getvirtualjoysticky(1)>0.0+0.5 then MoveCameraLocalZ(1,-moveSpeed#*GFT#)
if GetRawKeyState(37)=1 or getvirtualjoystickx(1)<0.0-0.5 then RotateCameraLocalY(1,-turnSpeed#*GFT#)
if GetRawKeyState(39)=1 or getvirtualjoystickx(1)>0.0+0.5 then RotateCameraLocalY(1,turnSpeed#*GFT#)
rem Gravity on camera
if ObjectRayCast( 0, GetCameraX(1), GetCameraY(1), GetCameraZ(1), GetCameraX(1), GetCameraY(1)-38.0, GetCameraZ(1))>0
if ObjectRayCast( 0, GetCameraX(1), GetCameraY(1), GetCameraZ(1), GetCameraX(1), GetCameraY(1)-33.5, GetCameraZ(1))>0
MoveCameraLocalY(1,-(10.0*GFT#))
else
MoveCameraLocalY(1,-(30.0*GFT#))
endif
else
MoveCameraLocalY(1,-(60.0*GFT#))
endif
rem New position
newx#=GetCameraX(1)
newy#=GetCameraY(1)-20.0
newz#=GetCameraZ(1)
`
rem Adjust Y to match floor
if ObjectSphereSlide(0,oldx#,oldy#,oldz#,newx#,newy#,newz#,12.0)>0
newx#=GetObjectRayCastSlideX(0)
newy#=GetObjectRayCastSlideY(0)
newz#=GetObjectRayCastSlideZ(0)
SetCameraPosition(1,newx#,newy#+20.0,newz#)
endif
I nead raycasting as i have curved corners in the map .
Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz