Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
4

[SOLVED] How do I detect parts around me with Lua?

Asked by
Klocko 20
9 years ago

I previously asked this question only to be rudely downvoted by a person who misunderstood and thought I was requesting a script to be made.

This: http://www.roblox.com/games/146363401/Dynamic-Parkour-Demo-Updated

I'd love to create one of my own.

I already have lots of scripting knowledge.

Any idea how to detect parts around me?

0
if you have scripting knowledge then make the script..... I told you before we aren't gonna make it for you. You have to make a decent attempt and then it there are bugs then we help FIX. Keyword FIX. This site does NOT make scripts for you NinjoOnline 1146 — 9y
0
...Oh god not you again. Why isn't it clear? I DO NOT want anyone to make it for me. I want to know HOW to make it. Be more helpful, please. Suggest something. Klocko 20 — 9y
3
"Any idea how" <- That is not a request. I feel downvotes are a bit too strict for this question. He's asking for a general concept DigitalVeer 1473 — 9y
0
Thank you for understanding Digital! :D Klocko 20 — 9y
View all comments (2 more)
0
This can be accomplished by using 'magnitude' (to me, at least). :) WIKI Document on Magnitude: http://wiki.roblox.com/index.php?title=Magnitude TheeDeathCaster 2368 — 9y
0
I would look into Region3 Goulstem 8144 — 9y

2 answers

Log in to vote
2
Answered by 9 years ago

There is the parameter "otherPart" you can use. It will return the parts touching the part the script is in.

Maybe duplicate a script like this into the player's limbs.

Like you asked, just a general idea!

Ad
Log in to vote
0
Answered by
ZeroBits 142
9 years ago

from what I understood, you wanted a list of parts near you, now there are two ways we could go about this, we could iterate through all the parts in the Workspace and child models, and use magnitude to detect if they're close, or we could define a Region3 wiki link around the player, but the region's position will need to update a few times per second to keep up with the player, especially in a parkour game, but it should still be a lot more efficient than iterating through all the parts everywhere, then use this function (FindPartsInRegion3) to get all the parts.

no matter what you do, there's not a really efficient method, but Region3s seem to be the most efficient, also, a message to any master scripter that might read this; if there is a more a efficient method, I'd like to know.

1
You could cast a ray, but It wouldn't be as accurate as a region3, although it would allow for easier handling and might be more specific, depending on the situation. parkderp1 105 — 9y
0
^With raycasting you could definitely obtain information about where parts are relative to the player easily. But yes, Region3 is probably the most effective and efficient method for this. Goulstem 8144 — 9y

Answer this question