Why does my sphere not move?
So I'm moving a object with this line of code: this.transform.position = Vector3.MoveTowards(transform.position, target.position, step);
The object I am moving is supposed to push a sphere. Unfortunately, the object is moving to the determined target without pushing the sphere away. Both objects have a collider activated. I tried it with adding 'RigidBody' but it didn't solved my Problem neither (I'm pretty new to Unity, though).
What did I do wrong?
Thank you very much in advance for your advice/ help!
I found out that this kind of movement just "teleports" my object to the second Position ins$$anonymous$$d of moving it. Does someone know how I can push the sphere away when both objects collide?
Answer by Dream_in_code · Aug 26, 2016 at 05:13 PM
You dont need to activate both colliders. if the collider is activated you need to write what will the object do if it collides,Turn off both coiiliders. You need a rigidbody attached to target as well
Answer by DominikHeyn · Aug 26, 2016 at 06:07 PM
First of all, thank you for your answer! Unfortunately this doesn't work for me :(
Maybe trying to explain what I want to do makes it probably easier to understand my problem. I'm trying to make a, kind of classic, pinball game. I'm moving the flippers pressing a button. So when the sphere is rolling down and I press the buttons to move the flippers, they just ignore the sphere. :(
can you send me the picture of your project with the inspector setting of both player and the flipper pls?
I've solved my Problem with another method. Thank you anyway for your effort!