#RenderStepped or check Touched

1 messages · Page 1 of 1 (latest)

blazing wasp
#

I’ve set up a custom prompt system, and I’m wondering which method is better in terms of performance or practicality.
One approach uses RenderStepped to check every frame for each object in a hardcoded directory:

RunService.RenderStepped:Connect(function()
    local closestEntry, _ = getClosestPrompt()
    if closestEntry then
       interactFrame.Visible = true
       textInfo.Text = closestEntry.Action or "Placeholder"  
    else
       interactFrame.Visible = false
    end
end)

The other approach checks whether a part is touched, like detecting if the player is within a prompt's max reach (e.g., the red circle).
I have no idea how the framerate would be affected if there are around 1,000 objects that require custom prompts — such as NPCs, harvestable spots, etc.

viscid fossil
#

Pretty sure you can customize a prompts looks

#

This would lag your game out

#

By a bunch

blazing wasp
#

So i need to add Prompt to every object? Cause Tagged everthing, like Talk, collect etc. so if i go near a object its shows instead of PlaceHolder the Tag, The Tag gets created by script for a set folder

viscid fossil
#

You can also just run a for loop trough every object

blazing wasp
#

for what?

viscid fossil
#

For loop?

blazing wasp
#

loop what

viscid fossil
#

For i, v in table do

#

Do you not know what a for loop is

blazing wasp
#

i mean what does the loop check, The RenderStepped checks the distance of every object so it knows when to show the GUI

low stream
#

Is your custom prompt similar to roblox's proximity prompt

viscid fossil
#

Create a folder with all the items, clone the special prompt in the script and add it to all the models in the for loop

stray riverBOT
#

studio** You are now Level 11! **studio

viscid fossil
#

🔥

blazing wasp
viscid fossil
#

Prompt.style = enum.proximitypromptstyle.custom

low stream
viscid fossil
blazing wasp
viscid fossil
#

Oooh

#

Under there?

low stream
# blazing wasp

use roblox's proximity prompt, set it to custom and use prompthidden/shown event

blazing wasp
low stream
#

you can do the same

viscid fossil
#

Just make one renderstepped and loop trough all the parts and make it appear if one of them is within like 10 studs (and make sure to break the loop then)

blazing wasp