Jump to content

entity:GoToPoint() doesnt work, or what am I doing wrong


Slastraf
 Share

Recommended Posts

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

post-12189-0-75522400-1437163937_thumb.png

Link to comment
Share on other sites

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.

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

  • 9 months later...

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/

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

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...