Jump to content

Search the Community

Showing results for tags 'terrain collision'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Models
    • Animals
    • Barriers
    • Characters
    • Containers
    • Environments
    • Furniture
    • Props
    • Rocks
    • Vegetation
    • Vehicles
    • Weapons
  • Materials
    • Brick
    • Cartoon
    • Decals
    • Dirt
    • Grass
    • Industrial
    • Medieval
    • Metal
    • Plastic
    • Plaster
    • Rock
    • SciFi
    • Sky
    • Signs
    • Tile
    • Stone
    • Walls
    • Wood
  • Plugins
  • Scripts
    • GUI
    • Object
    • Utilities
  • Shaders
    • Post-Processing Effects
    • Surface
  • Sounds
    • Ambience
    • Effects
    • Music
  • Tools
  • BATTLE LEAGUE's Assets
  • BATTLE LEAGUE's Mods

Blogs

There are no results to display.

There are no results to display.

Forums

  • Leadwerks
    • Technical Assistance
    • General Discussion
    • Programming
    • Game Art
    • Suggestion Box
    • Bug Reports
  • Platforms
    • Windows
    • Mac
    • Linux
  • Community
    • Showcase
    • Promotion
    • Off-topic
  • BATTLE LEAGUE's Topics
  • Vec-Tec's Releases
  • Vec-Tec's Topics
  • Forth's Development
  • Forth's Game design
  • Forth's Graphics
  • Forth's Documentation
  • Forth's TODO
  • Forth's IMPORTANT
  • Forth's Screenshots
  • The uncertain world's Game Design
  • The uncertain world's Programming
  • The uncertain world's TODO
  • The uncertain world's Graphics
  • The uncertain world's Screenshots

Categories

  • Records
  • Entity
  • Command Reference
  • Vec3
  • Vec4
  • Script Reference
  • Shader
  • Index
  • Material
  • Object
  • Buffer
  • Asset
  • Font
  • Shape
  • Sound
  • Texture
  • App
  • Context
  • Model
  • Light
  • DirectionalLight
  • PointLight
  • SpotLight
  • Attractor
  • Camera
  • Emitter
  • Listener
  • Pivot
  • Bone
  • Sprite
  • FileSystem
  • Key
  • Source
  • Surface
  • Math
  • AABB
  • dVec3
  • Mat3
  • Mat4
  • Plane
  • Transform
  • Vec2
  • Vec3
  • Vec4
  • Mutex
  • Prefab
  • PickInfo
  • Map
  • Stream
  • System
  • Thread
  • Time
  • Window
  • World
  • Driver
  • SoundDriver
  • GraphicsDriver
  • PhysicsDriver
  • OpenGL2GraphicsDriver
  • OpenGLES2GraphicsDriver
  • OpenALSoundDriver
  • NewtonDynamicsPhysicsDriver
  • Draw
  • Color
  • Blend
  • Joint
  • Debug
  • Component
  • Steamworks
  • LensFlare
  • Vehicle
  • Decal
  • Quat
  • Leaderboard
  • Probe
  • Analytics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


Interests

Found 1 result

  1. Greetings all, I am very new to using the Leadwerks engine and I am having trouble getting my player entity to move across the terrain I've created. The FPSPlayer.lua script works in this regard, but it was not compatible with what I needed for this project, so I had to write my own character controller script. Everything I've tried results in either the player entity falling through the terrain upon start or moving along the origin plane and passing through the terrain instead of climbing/colliding with it. I have dug through the FPSPlayer.lua script trying to find where this functionality was implemented, but I am unable to find it. Any help would be greatly appreciated. Here is my script" Script.moveSpeed = 4.0 --float "Movement Speed" Script.mouseTurn = 6.0 --float "Mouse Rotation Speed" function Script:Start() -- Create Camera self.camera = Camera:Create() self.pivot = Pivot:Create() self.camera:SetParent(self.pivot) self.camera:Move(0, 2, -2) self.camera:SetRotation(25, 0, 0) self.entity:SetKeyValue("type","player") end -- Adjust the camera orientation relative to the player function Script:UpdateCamera() self.pivot:SetPosition(self.entity:GetPosition()) self.pivot:SetRotation(self.pivot:GetRotation().x, self.pivot:GetRotation().y, 0) end function Script:UpdateWorld() local MoveX = 0 local MoveZ = 0 if window:KeyDown(Key.W) then self.entity:SetRotation(0, self.pivot:GetRotation().y, 0) MoveZ = MoveZ + 1 end if window:KeyDown(Key.S) then self.entity:SetRotation(0, self.pivot:GetRotation().y, 0) MoveZ = MoveZ - 1 end if window:KeyDown(Key.D) then MoveX = MoveX + 1 end if window:KeyDown(Key.A) then MoveX = MoveX - 1 end self.entity:Move(MoveX * self.moveSpeed / 2, 0, MoveZ * self.moveSpeed, false) if window:MouseDown(2) then if window:GetMousePosition().x > self.lastMouseX then self.pivot:Turn(0, self.mouseTurn, 0) end if window:GetMousePosition().x < self.lastMouseX then self.pivot:Turn(0, -self.mouseTurn, 0) end if window:GetMousePosition().y > self.lastMouseY then self.pivot:Turn(self.mouseTurn / 2, 0 ,0) end if window:GetMousePosition().y < self.lastMouseY then self.pivot:Turn(-self.mouseTurn / 2, 0, 0) end window:SetMousePosition(context:GetWidth() / 2, context:GetHeight() / 2) end self.lastMouseX = window:GetMousePosition().x self.lastMouseY = window:GetMousePosition().y -- Update The Camera Each Loop self:UpdateCamera() end
×
×
  • Create New...