I am trying to build a very physics-centric mini-game with lots of collision detection needed.
I have scripts moving parts around the game which in-turn push other models around the game and this does work 80% of the time. I have ‘tokens’ bouncing around a little arcade machine however some tokens ‘clip’ through the parts instead of being pushed.
Here is a token about to be pushed by a yellow part:
But the part ‘clips’ through it instead:
I do have about 100 of these tokens in the game and, as I say, it does work most of the time I just wonder if there are some settings to improve the fidelity of the collision detection? or should I have some script to double check any ‘clipping’ and handle that separately?
So I understand now that because the other game parts are just basic geometry they have no CollisionFidelity property so that makes sense.
Looks like my problem remains… I’m going to start looking at rolling my own scripts to determine when tokens are inside other parts. In your experience should the Roblox physics engine be good enough to handle these collisions without having to write custom lua to help? (I’m very new to Roblox dev)
If you replace the coins with different types of meshes do you get different effects? like surely a cube mesh with a decal on (so it looks like a round coin) would be the most efficient, i’d expect cylinders to work better than custom meshes, especially if the custom meshes have strange geometry, they probably need to be pretty low poly and based on tri’s rather than quads maybe?
I did some testing, everything works fine for me, i used cylinder meshes for coins, and prismatic constraints to move the pushers. are you using Cframes? that’s almost defiantly the problem
So my token model is a cylinder part with decals on it and then another cylinder part which I’ve made a negative union with to make a hole in the middle:
Looks like that’s my issue then just my model is too funky! Just stick to a simple cylinder then perhaps.
EDIT: I’m not sure about CFrames? I do use those to rotate the model part to begin with.
(thanks by the way spending so much time on this that demo is awesome!)
So now using just plain cylinders I still get the clipping so now I wonder if it’s how I’m actually moving the pushers! I just have a script setting the pusher’s Position and Velocity. I wonder if using these prismatic constraints is a better way to go?
Could you point me in the direction maybe of a good tutorial for doing what you did in that video please, moving the pushers via lua using prismatic constraints?
I’ve created a brand new workspace with just a handful of parts and the sliders now move using very simple Prismatic Constraints.
The counters and now just very simple cylinder parts and nothing is added at run time.
I have just a single script in the the ‘ServerScriptService’:
while true do
wait(1)
local pusherPrismaticConstraint
pusherPrismaticConstraint = game.Workspace.Pusher1:FindFirstChild("Pusher1PrismaticConstraint")
if pusherPrismaticConstraint.CurrentPosition >= -2.5 then
pusherPrismaticConstraint.TargetPosition = -3.2
elseif pusherPrismaticConstraint.CurrentPosition <= -2.8 then
pusherPrismaticConstraint.TargetPosition = -2
end
pusherPrismaticConstraint = game.Workspace.Pusher2:FindFirstChild("Pusher2PrismaticConstraint")
if pusherPrismaticConstraint.CurrentPosition >= -2.5 then
pusherPrismaticConstraint.TargetPosition = -3.2
elseif pusherPrismaticConstraint.CurrentPosition <= -2.8 then
pusherPrismaticConstraint.TargetPosition = -2
end
end
-Go backward
PrismaticConstraint.Velocity = -10
wait(5)
end
Probably work setting limits too.
it can be done in the studio window
but in code it’d be
prismaticConstraint.LimitsEnabled = true
prismaticConstraint.LowerLimit = 1
prismaticConstraint.UpperLimit = 10