generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Swordfighting AI?

Previous Thread :: Next Thread 
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
21 Apr 2016 11:24 PM
I have a NPC I want to follow another NPC and attack it with a sword (.Activated), I am using pathfinding service but I have two questions:

is there an efficient way to detect when the path needs to update/an efficient way to update the path when the target moves

and

how would I go about rotating the NPC with the sword to aim the sword at the target (so that it doesn't swing to the side or something)
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
22 Apr 2016 12:02 AM
burnp
Report Abuse
YourStoneMaster is not online. YourStoneMaster
Joined: 29 Mar 2013
Total Posts: 401
22 Apr 2016 01:35 AM
Well since your assuming your target would be moving all the time, computing a new path every time the target moves would be laggy. The way i would do it is make it the AI walk a max number of 8 steps then refreshing its path. If the AI gets close enough say about 20 studs, loop the :MoveTo() function on the target's torso. This way should also fix your sword problem.
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
22 Apr 2016 08:13 AM
but walking to the targets torso there is a possibility the target is turned sideways and the sword wont hit him it will go behind him
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
22 Apr 2016 06:34 PM
bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image