Slastraf Posted July 17, 2015 Share Posted July 17, 2015 I dont know what I am doing wrong, or if this is a bug. function Script:Start() end function Script:UpdatePhysics() self.entity:SetNavigationMode(true) self.entity:GoToPoint(100,0,100,1.4,1) end This script is attached to the prefab crawler. Inside the Game the crawler floats in mid air doing nothing, collision but no physics work. I have tried this in an other game with this, http://www.leadwerks.com/werkspace/page/tutorials_legacy/_/script/waypoints-and-simple-ai-r120 It is doing the same thing PS: the usual monstarAi script works fine Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 17, 2015 Share Posted July 17, 2015 The script you posted works fine for me but I would probably just set the NavigationMode in the Start function instead of constantly inside the update loop. The only thing I can think of would be that the physics mode is not set to Character Physics, no mass has been set, or that the point (100,0,100) can not be reached which would prevent the entity from moving. 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...
Slastraf Posted July 18, 2015 Author Share Posted July 18, 2015 oh yeah, the navigation mode was it. I have put them both in start function and updatephysics but not like that Quote Link to comment Share on other sites More sharing options...
Josh Posted July 18, 2015 Share Posted July 18, 2015 It's probably because you are constantly resetting the destination so it doesn't get a chance to actually move. Quote 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 More sharing options...
anthony_4n7 Posted May 8, 2016 Share Posted May 8, 2016 http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitysetnavigationmode-r192 Can any of you check this example as it seems it doesnt work. Was checking using this line: self.context:DrawText("NavMode: ".. tostring(self.entity:GetNavigationMode()).." "..self.player:GetPosition(true):ToString(),2,2) Quote Link to comment Share on other sites More sharing options...
macklebee Posted May 8, 2016 Share Posted May 8, 2016 http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitysetnavigationmode-r192 Can any of you check this example as it seems it doesnt work. It's missing the line: App.world:BuildNavMesh() Look at Entity:GoToPoint as a reference: http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entitygotopoint-r700 Edit: And interesting enough, the SetNavigationMode example, when fixed, highlights the bug report that shows characters walking through items with mass: http://www.leadwerks.com/werkspace/topic/14323-character-pass-through-objects-with-mass/ 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...
anthony_4n7 Posted May 8, 2016 Share Posted May 8, 2016 I added it as a comment to API page, also box position was too high so it wasnt counted as obstacle. :\ 1 Quote 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.