richardl008 Posted August 21, 2016 Share Posted August 21, 2016 Hi, there was once a script for moving the character to mouse position: Does anyone know where to find it - i get an error when i want to get/download/test it? Thanks, Richard Quote Link to comment Share on other sites More sharing options...
Jazz Posted August 21, 2016 Share Posted August 21, 2016 The old files were moved to Google drive. Try here: https://drive.google.com/drive/folders/0BxLsUYPSspxcfk9LTzllZGpacjV6WWtDelJnVGxwRU9lRDQzNUtSWHE0N2ZCc0Z2SVNQcnM Quote --- Scott Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060 Link to comment Share on other sites More sharing options...
macklebee Posted August 21, 2016 Share Posted August 21, 2016 I would assume its just a script using entity:GoToPoint() and camera:Pick()? example: window = Window:Create("example",0,0,800,600) context = Context:Create(window) world = World:Create() local camera = Camera:Create() camera:SetRotation(45,0,0) camera:Move(0,0,-8) local light = DirectionalLight:Create() light:SetRotation(35,35,0) camera:SetDebugNavigationMode(true) local ground = Model:Box(10,1,10) ground:SetPosition(0,-0.5,0) ground:SetColor(0.0,0.25,0.0) local shape = Shape:Box(0,0,0, 0,0,0, 10,1,10) ground:SetShape(shape) shape:Release() entity = Model:Box(1,1,3) entity:SetColor(0.0,0.0,1.0) entity:SetPosition(0,0.5,0) local shape = Shape:Box(0,0,0,0,0,0,1,1,3) entity:SetShape(shape) shape:Release() ground:SetNavigationMode(true) entity:SetNavigationMode(true) world:BuildNavMesh() player = Pivot:Create() local visiblecapsule = Model:Cylinder(16,player) visiblecapsule:SetScale(1,2,1) visiblecapsule:SetPosition(0,1,0) player:SetPosition(-4,0,0) player:SetMass(1) player:SetPhysicsMode(Entity.CharacterPhysics) while window:KeyHit(Key.Escape)==false do if window:Closed() then break end if window:MouseHit(1) then local pickinfo = PickInfo() local p = window:GetMousePosition() if camera:Pick(p.x,p.y,pickinfo,0,true) then System:Print(pickinfo.position:ToString()) player:GoToPoint(pickinfo.position,1.4,1) end end Time:Update() world:Update() world:Render() context:Sync(true) end 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Recommended Posts
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.