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 » Scripting Helpers
Home Search
 

Re: Pathfinding

Previous Thread :: Next Thread 
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
29 Jul 2014 11:28 AM
want an ai to get to a point.

start = game.Workspace.Part1.Position;
end = game.Workspace.Part2.Position;
game.Workspace.Part1:remove()
game.Workspace.Part2:remove()--so nothing is in the way
path = game:service("PathfindingService"):ComputeRawAsync(script.Parent.Torso.Position, end);


yeah....


what did I do wrong?

Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
29 Jul 2014 11:29 AM
You can't remove your points or else the path will have no points!

You can keep them there.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jul 2014 11:30 AM
end. Look at it and tell me why you don't use it as a variable
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
29 Jul 2014 11:31 AM
LOL Just noticed that.

Yeah, you should change it to finish.

Using end as a variable is like using nil as a variable; not good
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
29 Jul 2014 11:32 AM
Well, it starts where the ai is,,,, yes?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
29 Jul 2014 11:33 AM
Yes, but end is a blue word. It marks the stop of functions, loops, and if statements.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jul 2014 11:39 AM
"blue word"

blue words are usually keywords. Some blue words (IE: min) can be used fine.
Report Abuse
Patrolics is not online. Patrolics
Joined: 09 Aug 2013
Total Posts: 149
29 Jul 2014 11:39 AM
Why are there so many people who complain about Pathfinding!?!?! -.-
Why can't they just read the other answered threads?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
29 Jul 2014 11:40 AM
Because most of the problem concerning the same service are different.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
29 Jul 2014 11:40 AM
Lol, havin' brain farts aren't we there. "Blue words." XD
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
29 Jul 2014 11:42 AM
Just turn off CanCollide and make them invisible. Try that.
Report Abuse
connor954 is not online. connor954
Joined: 24 Jul 2008
Total Posts: 947
29 Jul 2014 11:42 AM
OH AND

its GetService not service.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
29 Jul 2014 11:46 AM
connor

service works 2
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
29 Jul 2014 11:48 AM
Hey, it's a nickname for "keywords" :C

Anyway :service () is deprecated and should be avoided (ALONG WITH :remove ()!)
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jul 2014 11:48 AM
All the camelCase methods and events are deprecated, and you should be using the CamelCase methods (Basically, its FindFirstChild, not findFirstChild)
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jul 2014 11:49 AM
Also, Remove is deprecated in favor of Destroy.

ClearAllChildren is not deprecated, but should be avoided in favour of using GetChildren, a for loop and Destroy.
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
29 Jul 2014 11:50 AM
Not, the capitalization of the first word in a method is irrelevant.

:destroy () == :Destroy ()
:findFirstChild () == :FindFirstChild ()

There are few outliers:
:connect () ~= :Connect () -- that will error
:Play ~= :play () -- also errors
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
29 Jul 2014 11:51 AM
Why is ClearAllChildren () not favored over :GetChildren () looping?
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
29 Jul 2014 11:53 AM
@maxomega3: I never said they did not work, I said not to use them as they are deprecated.

And ClearAllChildren does not use Destroy, but Remove, so you will get memory leaks if you use it when you have events connected.
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
29 Jul 2014 11:55 AM
Wow.
Lazy roblox!

Not, I'm pretty sure that they are the same method.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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