My game relies a lot on the .Touched event for stuff relating to mechanics that the players can place.
However, due to some reasons, sometimes this event doesn’t register causing issues.
Is there any alternatives to the event?
My game relies a lot on the .Touched event for stuff relating to mechanics that the players can place.
However, due to some reasons, sometimes this event doesn’t register causing issues.
Is there any alternatives to the event?
yeah I just rewrote all of the physics (easy for primitives, using hulls for meshes) and then made my own contact function it’s pretty easy
Though it isnt an event, you can use the workspace GetPartsBoundInX functions (such as GetPartsBoundInBox or GetPartsBoundInPart, etc.)
Though you would have to call it every frame to detect if theres a collision, it is simply just better than any alternative I’ve found so far and works pretty well. 10/10 would recommend.
I also recommend this
it sounds like OP has a tool that either places an object where the player’s mouse is, or places an object in front of the player’s character.
.Touched events only fire when at least one of the parts in the collision is unanchored (and most likely, the part that the tool is placing is anchored so it can hover in place)
spamming these queries is not healthy compared to events
this may be true, but too my knowledge there arent any other collision detecting things that use events
and in the case where it seems the OP is making a placing system, you only need to call it when you attempt to place something, which in theory can be less costly then the .touched event
post is vague. gettouchingparts would be apt for that use case (but thats fairly obvious)
nah thats not what it is
basically if a part touches another part for example it can do stuff like teleport the hit part or such
I love using parts in part and shape casting
By the way, do you know if there are any real differences between GetTouchingParts and workspace:GetPartsInPart?
other than the GetTouchingParts whole TouchInterest thing, are they any different in the way they detect the collisions?
Or is there some other difference they have? I’m just curious cause I don’t know if there’s a case to use one over the other.
Thanks!
The Creator hub recommends using the latter over the former.
https://create.roblox.com/docs/reference/engine/classes/WorldRoot#GetPartsInPart