Object too fast for Collision in Unity - c#

I'm currently making a simulation where disks are placed in a conveyor belt and sorted by color. When the sensor detects a white disk, a rectangular object 'pushes' out of the conveyor belt into a box, and it needs to move quickly. However, whenever we set the speed to a high number it just goes through the disks, without pushing them. I have already tried making the pushing object's collision detection 'Continuous dynamic' (RigidBody) and the disks' collision detection 'Continuous' (like in this video: https://www.youtube.com/watch?v=XvrFQJ3n8Mo). I have attached an image of how the mentioned part of the robot looks and the settings for both the disk and pusher object.
disk and pusher object settings
visualisation of robot simulation

Your problem has been solved HERE , in short it is because only convex mesh colliders can collide with each other. (Your right one is convex and the left one is not).

Related

How do you stop character in unity from overlapping with Platform?

Hi, as you can see from the above image, my player sinks into my platform. This is because
the platform isn't a flat surface. How do I stop the player from sinking into my platform?
So far I have tried to use layers, but I don't think this works for 3D objects. This is my first time creating a 3D game.
UPDATE: I've added colliders to both objects, but it still sinks.
Probably collider shape/placement. Possible reasons:
one or more colliders are not the shape you think they are. (click edit collider on its component to visualize
one or more colliders is set to isTrigger.
Concave generated mesh colliders can have unexpected results.

How to create multiplayer / shared AR game with Vuforia?

I would like to create a shared AR game on Android phones, where I would like to:
spawn a cube for each player on an ImageTarget
allow them to control the position of their cube
allow them to see the movements of all players' cubes
I'm using Vuforia as my AR library and PUN 2 as my networking library. I have no issue synchronizing the positions and rotations of all cubes. However, the cubes do not stay on the ImageTarget properly and "jump" around. On the other hand, if I place my two phones very close together and point them at the ImageTarget at roughly the same angle, the cubes do not jump as much.
This leads me to think that the 2 instances of ARCamera fail to realize that they are pointing at the same ImageTarget from 2 different angles, and instead think that the ImageTarget exists in 2 different orientations at the same time.
Is there any way for me to tell Vuforia that I'm using multiple instances of ARCamera pointing at the same ImageTarget? (Or if my hypothesis is completely wrong, how do I actually make a multiplayer AR game?)
Thanks so much in advance!
p.s. I know the Vuforia forums are a better place to ask this question but unfortunately that forum is not particularly active, so I'm trying my luck here.
I've solved the issue by going to the ARCamera gameobject, then in the Vuforia Behavior component, I changed the World Center Mode from DEVICE to FIRST_TARGET. This allows multiple instances of ARCameras to be in different positions.
More info on World Center Mode can be found here.

Unity Particle Collider with Particle

Unity
I create two collider effects and want them can have some function while them collider each other . but i don't know how to make two particle collider.
How to make fire and water can collider each and fire will be put out by water.
Thank for help!!!!
From the documentation (http://docs.unity3d.com/Manual/PartSysCollisionModule.html)
Send Collision Messages : Check this to be able to detect particle
collisions from scripts by the OnParticleCollision function.
Be careful though. Overdoing collisions and particles is a good way to get performance issues
Be sure to follow the tutorials for particle systems too!
https://unity3d.com/learn/tutorials/topics/graphics/particle-system
Thats the best I can currently do, given you have not supplied any work we can comment on.
The unity particle system can collide with colliders(objects) in the scene if collision is enebled for particle system.
But particle systems do not collide with each other. Particles have no volume, so it's not really possible.
You cannot use built-in particle system for fire and water and have them collide with each other. However, you can create a custom particle system using actual objects having colliders which can work as you expect.

How do you simulate a liquid inside a bottle using Unity?

I need bottles to be filled with liquid in UNITY 3D. As Unity doesn't have liquids, I need to simulate them. Can you suggest me on how I can achieve these following functionalities with liquid simulation :
3D Object with any shape (Bottle, Conical flask, beaker etc) must be filled with liquid. The volume of liquid to be filled is a variable, which will be decided by the user.
When I tilt/rotate the object, physics must act upon the liquid inside the object as shown in the figure. Liquid inside a bottle and it has to move depending on how the bottle is positioned in 3D.
,
I had tried with Stencil buffers, particle system, Cloth component etc. But couldn't achieve with any of them.
The problem with particle system is that, it is heavy performance and the particles are leaking out from the sharp edges of the GameObject's mesh, even though the Collision is enabled for the particle system. With stencil buffers, I didn't understand how liquid inside a object can move depending upon the positioning of the object.
Any suggestions or solutions are appreciated.
There is good assest on the assets store. For GPU based Fluid Simulation.
https://www.assetstore.unity3d.com/en/#!/content/65359
You can give it a shot.

Trying to write generic code for a board game

I'm actually working on a board game using unity. It's a board game where players have to connect two opposites borders by claiming empty hexagonal cases. Borders are assigned to players at the beginning.
I chose to represent my empty cases with gems, white when unclaimed, and red or blue for players. So I made a single prefab for all gems.
To check connections between gems themselves and with borders, I assigned to them slightly bigger box colliders so they are colliding (trigger) with other objects, so I can detect if a claimed gem is connected (directly or not) to a border. I wrote this code generically as gems are one single prefab, naively thinking that every entity would run its own version of the script.. But that's not the case.
So I'm looking for an alternative way to detect connections with borders, but still generically, as the size of the board is variable.
Thanks in advance !
Your problem is closely related on how you break your game in game objects and components on Unity3D.
First of all, use scripts to define components. For example your gems could have a script that contains data related to its state (your white, red and blue gems meaning empty, playerA and playerB).
You will probably need a game object (normally called a GameManager) to handle all behavior related to game rules like which player is playing, if a player can pick a specific gem and if a player won the game. Depending on the game complexity is a good idea to also have a game object with a component (script) to keep your board state, instead of simply getting it from the gems objects Transform component.
After you have structured your game you do not need colliders to detect connections. Every time you have to check for connections, just iterate over your gems or use your board state object.
Edit:
References to help you develop your game:
How do I represent a hextile/hex grid in memory?
Creating a holder for game level for simple board tile based game.
creating 2d table\chess board\2d array

Categories