Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / BUG? in 3d physics character controller.

Author
Message
VictorFR
9
Years of Service
User Offline
Joined: 3rd Aug 2016
Location:
Posted: 24th Aug 2016 20:25
I'm starting use 3d physics and have a strange problem. If i running game on android devise or PC it have not bug, but when running in AppGameKit player on my iPad is have strange bug
There is code.


// Project: T22
// Created: 2016-08-24

// show all errors
SetErrorMode(2)
Global player
global cub
// set window properties
SetWindowTitle( "T22" )
SetWindowSize( 1024, 768, 0 )

// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
Create3DPhysicsWorld(1)

cub=CreateObjectBox(10,1,10)
SetObjectPosition(cub,0,-1,0)
Create3DPhysicsStaticBody(cub)
SetObjectShapeBox(cub)
sync()

player=CreateObjectBox(2,2,2)
characterOffsetVec = CreateVector3( 0.0, -0.1, 0.0 )
//This vector indicates the axis your model faces forward.
//For example if your model faces down the - Z axis use this vector.
objectOrientationVec = CreateVector3( 0, 1, 0 )
Create3DPhysicsCharacterController( player, 1, characterOffsetVec, objectOrientationVec, 1)
Set3DPhysicsCharacterControllerPosition(player,0,10,0)
Set3DPhysicsCharacterControllerStepHeight(player,0.1)
DeleteVector3( characterOffsetVec )
DeleteVector3( objectOrientationVec )

///===========================================//
addvirtualbutton( 2, 150,600,70 )
addvirtualbutton( 3, 50,550,70)
addvirtualbutton( 4, 250,550,70)
addvirtualbutton( 5, 800,550,70)
Addvirtualbutton(6,150,455,70)


//============================================//
do

moveplayer()
Step3DPhysicsWorld()
Sync()
Print( ScreenFPS() )


loop
function moveplayer()
WalkVelocity=5
Move3DPhysicsCharacterController( player, 0, WalkVelocity)

if GetRawKeyState( 87 ) or GetVirtualButtonState(6)=1
Move3DPhysicsCharacterController( player, 1, WalkVelocity )
move = 1
endif

if GetRawKeyState( 83 ) or GetVirtualButtonState(2)=1
Move3DPhysicsCharacterController( player, 2, WalkVelocity )
move = 1
endif

if GetRawKeyState( 65 ) or GetVirtualButtonState(3)=1
Move3DPhysicsCharacterController( player, 3, WalkVelocity )
move = 1
endif

if GetRawKeyState( 68 ) or GetVirtualButtonState(4)=1
Move3DPhysicsCharacterController( player, 4, WalkVelocity )
move = 1
endif

if GetRawKeyPressed( 32 ) or GetVirtualButtonState(5)=1
Jump3DPhysicsCharacterController(player)
endif



endfunction

And there is bug - my 3d object cube does not moving and his position inner big cube... I have not idea

Attachments

VictorFR
9
Years of Service
User Offline
Joined: 3rd Aug 2016
Location:
Posted: 24th Aug 2016 20:37
Hello
blink0k
Moderator
13
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Aug 2016 01:30
i think you need to Set3DPhysicsObjectCanSleep to off. explanation here;
https://forum.thegamecreators.com/thread/217544
VictorFR
9
Years of Service
User Offline
Joined: 3rd Aug 2016
Location:
Posted: 25th Aug 2016 07:14
blink0k its work with dynamic body,not character controller.
blink0k
Moderator
13
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Aug 2016 08:52
Sorry i couldn't help victor
Stab in the Dark software
Valued Member
23
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 26th Aug 2016 00:36
I can not test your code on an I-Pad because I do not have an I-pad.
Does the character controller demo posted here work on your I-Pad?
If so then there is a mistake in your code.
The coffee is lovely dark and deep,and I have code to write before I sleep.
VictorFR
9
Years of Service
User Offline
Joined: 3rd Aug 2016
Location:
Posted: 26th Aug 2016 06:06
Stab in the Dark Hello. Yes i had test it but see bug like my, the character controller drop down in the ground and dont move.
Stab in the Dark software
Valued Member
23
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 26th Aug 2016 16:19
Can anyone else confirm that the official Character Controller demo does not work on an I-Pad?
The coffee is lovely dark and deep,and I have code to write before I sleep.

Login to post a reply

Server time is: 2026-07-19 05:06:32
Your offset time is: 2026-07-19 05:06:32