A problem with tweening parts that have ProximityPrompt

Hi! Recently i was making a conveyor where eggs are going, by tweening CFrames of the parts that have attachments which are parents of the ProximityPrompts. ProximityPrompts start spamming. The video of what’s going on is below. I tried bunch of things, changing the indicator distance/making ProximityPrompt parent of the part itself, nothing helps. I found a might resolution that says that i have to make a ProximityPrompt on the server, though I’m not sure that may help and i strongly need it to be run on the client.

-- Proximity prompt properties
	ProximityPrompt = PlotLocalFunctions.CreateProximityPrompt(ProximityAttachment, function(ProximityPrompt: ProximityPrompt)
		ProximityPrompt.KeyboardKeyCode = Enum.KeyCode.E
		
		ProximityPrompt.Enabled = false
		
		ProximityPrompt.ObjectText = "$"..AbbreviatedCost
		ProximityPrompt.ActionText = "Purchase Egg"

		ProximityPrompt.MaxIndicatorDistance = 10
		ProximityPrompt.MaxActivationDistance = 20

		ProximityPrompt.HoldDuration = .5

		ProximityPrompt.RequiresLineOfSight = false
	end) :: ProximityPrompt

https://gyazo.com/c8dd2e874ace5bb389522fe0afccecf2

is the proximity prompt being created in a loop? (for instance, the CreateProximityPrompt might be making a new prompt eachtime it calls?)

1 Like
function PlotLocalFunctions.CreateProximityPrompt(ProximityParent: BasePart | Attachment, SetupFunction: (ProximityPrompt) -> ()): ProximityPrompt
	local ProximityPrompt = Instance.new("ProximityPrompt", ProximityParent)

	SetupFunction(ProximityPrompt)

	return ProximityPrompt
end

It supposed to create ProximityPrompt for each egg. Once eggs enter the conveyor door, the ProximityPrompt auto-destroys. Server send a RemoteEvents each time egg is needed to be spawned.

Have you tried setting the ProximityPrompt.RequiresLineOfSight to false to avoid potential collision?

I have actually did it, you can take a look higher in the thread of the topic.

What is that ? That’s not on the document page, is ProximityPrompt in the create ProximityPrompt function a table ?

It might be because of the indication distances of the other eggs overlapping with eachother, Did you try changing the ProximityPrompt.Exclusivity property?

I’ve tried doing this. That kind of works but the main problem is still exists, there is a spam of showing up and closing ProximityPrompt menu while tweening CFrame of it’s parent when the magnitude close to the maximum ProximityPrompt activation distance.

Here’s how it looks even with the AlwaysShow.

https://gyazo.com/f063e96e8798c2201633fe610e41af84

Maybe its the tweening itself that is making the proximity prompts start flashing? Could you try unanchoring the eggs and making them go on an actual conveyor with a linear velocity?

I do agree with you that tweening causes this. I’ll try to this once i get time, but i’m not sure that it will help.

try creating the proximity prompt and then play the conveyor tween with linear velocity