SimpleZone | A simple, fast and new Zone module!

In general Roblox already has optimized alot of things in the game for you, all you need to do is to build things smart and nothing should be laggy :slight_smile:

1 Like

But I am still interested in optimising. What would you recommend for optimisation?

It really depends what youā€™re trying to do, give me an example.

Im using Fastcast and it tends to get laggy at times
I use it for caculating fired bullets from a npc with a gun
And im thinking about running fastcast in parralel or someting like that

Think about if you actually need to use FastCast or not, just ordinary raycasting like CS:GO would probably work well and be way more performant + easier to optimize

FastCast calculates many raycasts at once so sure running it in parallel would make it smoother, but again itā€™s not fixing the root issue.

1 Like

Is it a good practice to only do one raycast if the target is close enough?
I am also aiming for realism because im making the bullets dip down due to gravity

Thatā€™s a pretty good way of doing it, only use FastCast if the distance is far enough.

1 Like

You can share your resource without trying to put down someone elseā€™s. All that does is make you look inexperienced and rude. Show some more respect for fellow creators that put out free content for the community.

ZonePlus isnā€™t really slow and spaghetti coded, thatā€™s a pretty big exaggeration. How would you feel if someone picked apart your code here with their own module and made some condescending remark toward yours?

That being said it looks like a fine resource, the other stuff was just unnecessary

2 Likes

Sorry, was really just a way to get people in who are looking for alternatives, I can remove the bad remarks if you want :sweat_smile:

I mean I didnā€™t make zoneplus so it doesnā€™t really bother me, Iā€™m just telling you it makes you look like you have an ego. Part of being a respected creator is being a mature person and respectful to others, not just having good code

1 Like

Yeahā€¦ my bad, it was a bad attempt at clickbait, Iā€™ll remove it.

1 Like

The SimpleZone post has reached 1k views!!!, thank you for everyone who has used this module, it means alot to me

I donā€™t see any remarks, I see he must have removed it however I think it is very important to note that ZonePlus has been ā€œabandonedā€ essentially and has heavy memory leaks, and that a comparison to it would be nice (respectfully).

Donā€™t know what was said before though, and I agree with not putting down other developers.

I have a problem with the newest versionā€¦

	local GoalZone1 = ZoneModule.new(GoalZonePart1, {FireMode = "OnEnter"})
	local GoalZone2 = ZoneModule.new(GoalZonePart2, {FireMode = "OnEnter"})
	
	GoalZone1:ListenTo("Part", "Entered", function(Part)
		
		if Part.Name == "Ball" then
			print("BallEntered")
		end
	
		
	end)
	
	GoalZone2:ListenTo("Part", "Entered", function(Part)
		
		if Part.Name == "Ball" then
			print("BallEntered")
		end
		
	end)
	
	GoalZone1:BindToHeartbeat()
	GoalZone2:BindToHeartbeat()

GoalZone1 and 2 are both basepartsā€¦
Im pretty sure Im doing all the methodology correct.

It wont detect it for some reason.

Anything I should change?

2 Likes

Is the ball exiting and entering the Zone quickly?

No. Im moving it using the select tool. It would be fast in real gameplay however

Is the ball unanchored? When I did a test in Studio, for some reason moving unanchored parts in and out of Zones with the Move tool was very unreliable. However, normally it should work.

its anchored. Moving it on the server side.

Script was a serverscript

Hmm, Iā€™ll try replicating the issue and let you know if I have any fixes

test.rbxl (109.8 KB)
Heres a file so you can have exactly what I have