- Home /
Rotational clackers
I am trying to reproduce those infamous clackers. Two plastic balls tied together and the player moves the center point of the string to get the balls to 'Clack'' together. In my current case I dont want to move the center point but merely spin the orbit of the first ball to collide with the second ball on same orbit. I have two spheres which are on the same orbit around a center. The center is a empty gameObject. I want to 'send' the sphere 'A' around (which is rotate parent gameObject) till it collides with the sphere 'B' at which point both will be subject to an impact and bounce off each other, reversing their orbits from each other.. Right now I use a hingejoint in both sphere gameObjects on the same center gameObject. As it stands now, when I spin the gameObject 'A' into gameObject 'B' the sphere 'A' goes right through sphere 'B'. Sphere 'B' doesnt move and sphere 'A' drifts away from the view and its parent. I searched for this dilemna and it seems like there are alot of developers struggling with this same idea of getting this to correspond correctly. My theory is Unity is a first person walker engine and once you step outside of that model you are stuck in code land. I have tried spherical colliders on the spheres themselves and on the gameObjects at the sphere positions. Any posts would be welcome. I will forgive if you mention locking positions or axis. This is done and doesnt seem to enable my goal. Thank you in advance. The main question is can the Unity physix engine be used in this fashion? And that is to have two objects collide and then rebound rotating on the same offset axis to then collide at the 180 degree point only to collide and rebound to repeat this same process over and over again. Like a clock mechanism.
Indeed, unity is not mean to provide an accurate physics simulation: it's a game engine, and optimized for that.
That being said, I would not expect properly configured colliders, with rigid bodies, to just "pass through" each other. I would suspect a configuration error, but obviously need more details to deter$$anonymous$$e that. I would suggest starting with a simpler scene, and getting collision working, then move on to parent objects, then hinges, and so on.
@Glurth, I appreciate the answer. I have 5 years experience with Unity and because I wish to use the package like a free space artists canvas I have run into these problems numerously. I still have to ask the community about. I have great ideas that always cause me fits in unity. And yes we agree that unity is made mostly for going forward down a path ins$$anonymous$$d of serious mechanical modelling dissertative package. Oh well. I will write code. Cant hurt to try the easy way first though, eh?
If you like: Package up your project, and post what you've got so far. I'll take a look and see what I can do; sounds pretty interesting. (if you can't post it for some reason, I am: glurth at gmail dot com)
Answer by Glurth · Dec 17, 2016 at 08:12 PM
OK, couldn't resist trying this out. I have attached a package with a scene and physics material, setup that seems to work with that your looking for. I have NOT tested it extensively.
Edit: just updated the file. Now you can drag the Handle object's Y position up and down (during play-mode) to actually play with the clacker we know and love! fun! Edit2: hmm lets try that againlink text
Answer by giantkilleroverunity3d · Dec 18, 2016 at 06:29 AM
@Glurth Yep. Infinite blessings be upon you Sir. This is what many have been trying. May this answer get the universal showing it needs. There are alot of developers who want Unity to project a situation where the viewer/player can exercise some option to produce an action that is different from a player traveling a forward path to viewing an activity environment. I will work on this as a template to investigate my desire with what Unity actually does.
I could not ship what my current work as it includes two purchase packages that my project rely on.
This initially relies on gravity. I will pursue altering this to horizontal process. I cannot thank you enough. I was in 'Analysis paralysis' with my initial thought process. This solution helped me out of that stinkin thinkin! I surely hope this answers for many stuck in their design.
:) Glad you like it! Just shoot me an email, I'd rather have a fellow unity developers contact info than a donation! Glurth at gmail
Your answer
Follow this Question
Related Questions
Mathf.Sin only returning positive values? 2 Answers
Issues rotating around transform.up 2 Answers
Keep AI from flipping? 1 Answer
Rotation gameobject 0 Answers