Nevermind everything I just said... except the "EXCEPTION_ACCESS_VIOLATION" part. Every time I press escape, it pulls up that message and leaves the Editor.... this is my script...
require("Scripts/math/math")
controller = CreateController(1.8,0.45,0.25,45)
controller:SetCollisionType(COLLISION_CHARACTER)
controller:SetMass(10)
controller:Move(Vec3(0,1,0))
character = LoadModel("abstract::steampunk.gmf")
character:SetParent(controller)
character:SetRotation(Vec3(0,180,0))
pivot = CreatePivot(steampunk)
pivot:SetParent(controller)
camera = fw.main.camera
camera:SetPosition(Vec3(3,2,-10))
camera:SetParent(pivot)
move = 0
strafe = 0
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2)
camRotation = Vec3(0)
dx = 0.0
dy = 0.0
HideMouse()
while KeyHit (KEY_ESCAPE)==0 do
if KeyDown(KEY_LSHIFT)==1 then
camera:SetPosition(Vec3(.5,1.35,-1))
controller:Crouch(1)
cameraHeight = 0.3
moveSpeed = 3
strafeSpeed = 3
else
camera:SetPosition(Vec3(0,1.35,-2))
controller:Crouch(0)
cameraHeight = .5
moveSpeed = 1
strafeSpeed = 1
end
mx=Curve(MouseX()- GraphicsWidth()/2,3.0/AppSpeed())
my=Curve(MouseY()- GraphicsHeight()/2,3.0/AppSpeed())
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2)
camRotation.x = camRotation.x + my / 8
camRotation.y = camRotation.y - mx / 8
camRotation.x = math.min(camRotation.x, 45)
camRotation.x = math.max(camRotation.x, -15)
move = Curve( (KeyDown(KEY_W)-KeyDown(KEY_S)) * 5, move , 3 )
strafe = Curve( (KeyDown(KEY_D)-KeyDown(KEY_A)) * 5, strafe , 3 )
controller:Update(camRotation.y, move * moveSpeed, strafe * strafeSpeed, jump, 25, 10, KeyDown(KEY_LSHIFT))
fw:Update()
pivot:SetRotation(camRotation,1)
fw:Render()
Flip(0)
end
ShowMouse()