what do you mean by moving it a bit down?
it's starting location?
you set that with SetObjectPosition(slotonepickupweapon, xtwo, ytwo, ztwo), i set it to the camera location but if you want it to start a bit lower then lower ytwo
// Project: 3dphysicstest
// Created: 2019-04-13
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "3dphysicstest" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
Create3DPhysicsWorld()
box = CreateObjectBox(2,2,2)
Create3DPhysicsDynamicBody(box)
ground = CreateObjectPlane(1000,1000)
MoveObjectLocalY(ground,-5)
RotateObjectLocalX(ground,-90)
Create3DPhysicsStaticBody(ground)
SetObjectColor(ground,0,100,0,255)
oldmouse = GetRawMouseX()
do
if GetRawKeyReleased(27) then end
if GetRawMouseRightState()
if GetRawMouseX() > oldmouse
RotateCameraGlobalY(1,1)
elseif GetRawmouseX() < oldmouse
RotateCameraGlobalY(1,-1)
endif
oldmouse = GetRawMouseX()
else
oldmouse = GetRawMouseX()
endif
if GetPointerReleased()
//Delete3DPhysicsBody(box)
x1 = GetCameraX(1)
y1 = GetCameraY(1)-random2(0,10)
z1 = GetCameraZ(1)
SetObjectPosition(box,x1,y1,z1)
SetObjectRotation(box,GetCameraAngleX(1),GetCameraAngleY(1),GetCameraAngleZ(1))
MoveObjectLocalZ(box,15)
MoveObjectLocalY(box,15)
x2 = GetObjectX(box)
y2 = GetObjectY(box)
z2 = GetobjectZ(box)
SetObjectPosition(box,x1,y1,z1)
Create3DPhysicsDynamicBody(box)
SetObjectShapeBox(box)
SetObject3DPhysicsMass(box, 1.5)
SetObject3DPhysicsFriction(box, 1)
SetObject3DPhysicsCanSleep(box, 1)
SetObject3DPhysicsLinearVelocity(box,x2-x1,y2-y1,z2-z1,100)
endif
x2 = GetObjectX(box)
y2 = GetObjectY(box)
z2 = GetobjectZ(box)
//SetCameraLookAt(1,x2,y2,z2,0)
Print( ScreenFPS() )
Print(x2)
print(y2)
Print(z2)
Step3DPhysicsWorld()
Sync()
loop
if you want it to travel downwards faster then you have already done that by changing the MoveObjectLocalY() value down but if you go below 0 it may start going back upwards in velocity when you calculate ytwo-yone so you'll want to check for that perhaps
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu