Jump to content

Error Lua Script code.


Yue
 Share

Go to solution Solved by Josh,

Recommended Posts

--Error here 
    function me:StartPlayer()
        if me.mesh == nil then 
            me.mesh = LoadModel(me.world,"Models/Developer/Generic/generic.mdl")
            me.mesh:SetPosition(0,0.15,0)

            me.collider = CreateCylinder(me.world, 0.3, 1.5, 16, 1, 1)
            me.collider:SetColor(1,0,0,0.1)
            me.collider:SetPosition(0,1.1,0)
            me.collider:SetMass(78)
            me.collider:SetCollisionType(COLLISIONTYPE_PLAYER,false) -- Close App.
            
        end 
    end 

function me:StartCamera()
        if me.camera == nil then 
            me.camera = CreateCamera(me.world)
            me.camera:SetDebugPhysicsMode(true) -- Error Here too.**
            me.camera:SetFov(75)
            me.pivotNeck = CreatePivot(me.world)
            me.camera:SetPosition(0, 0, -me.followdistance) -- Set initial position and eye height
            me.camera:SetRotation(0, 0, 0)
            me.pivotNeck:SetRotation(me.freelookrotation) -- Synchronize with freelook rotation
            me.camera:SetParent(me.pivotNeck, true)
        end
    end

 

I have error when using the commands in Lua script. 

me.collider:SetCollisionType(COLLISIONTYPE_PLAYER,false)

and me.camera:SetDebugPhysicsMode(true)

image.thumb.png.030fef2315d1880ef8d5401330523bc4.png

 

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

  • Solution

The value should be COLLISION_PLAYER. Where is COLLISIONTYPE_PLAYER coming from?

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...