Jump to content

AI runs on spot/wont attack player


JohnBobSmith
 Share

Recommended Posts

Hello all. As I am experimenting with Leadwerks, I have come across a strange issue. My monster runs on the spot, and wont chase the player. I am using all the default scripts and assets. Heres what I have done:

 

-Drag the player prefab into the 3D viewport

-Drag the monster prefab into the 3D viewport

-Drag the player prefab from the scene view to the target slot of the monster's monsterAI.lua script.

-Run the game

-Monster runs on spot and doesnt attack the player unless I am really close and even then I need to shoot the monster to initiate the attack...

 

I'm probably missing something obvious, but this is strange nevertheless.

 

The desired result is that the monster(s) will find and run towards the player and attack the player.

 

All help appreciated!

I'm an enthusiast developer looking to make games for Linux. :D

Link to comment
Share on other sites

Where can I find the command reference? Also, it seems strange that the default monster does not have this feature built in. Whats a navmesh and how do I make one?

 

Again, sorry for sounding stupid. I will google around and post back my answers here if I find any. Thanks for the help!

I'm an enthusiast developer looking to make games for Linux. :D

Link to comment
Share on other sites

Hm, alright. Now to figure out why I can run through a stock barrel (it appears to have no collision)... I will google that now.

 

Use the prefab barrel it's already set up for physics

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

To give entities collision they need a Physics Shape. See the physics tab of the entity.

You can choose a collision type for the entity to make it collide with other entities. See collision reference here - http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778

 

Then if you want the entity to move when it collides it needs a mass above 0. If you want it to stay still (Like the ground, walls, ceilings) give it a mass of 0.

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