Unity object going through wall
What I've tried and checked:
- Object has a non-trigger sphere collider
- Object has
RigidBody
- Object has very low mass
- Object is using Continuous Collision Detection
- I am adding a low force to the
RigidBody
atStart
, notUpdate
, instead of manually moving every frame - Wall has a non-trigger box collider
- Wall has
RigidBody
- Wall is using Continuous Collision Detection
Some other things to note that I don't think the matter is that the object's parent also has a RigidBody
.
Before this, I was using a RayCast
to move it out of the ground, but that was causing bugs when it went over inclines, and I would really like it to just work, but for some reason, the ball just goes through inclines, instead of going up them, even after everything else I've tried.
c# unity3d physics
add a comment |
What I've tried and checked:
- Object has a non-trigger sphere collider
- Object has
RigidBody
- Object has very low mass
- Object is using Continuous Collision Detection
- I am adding a low force to the
RigidBody
atStart
, notUpdate
, instead of manually moving every frame - Wall has a non-trigger box collider
- Wall has
RigidBody
- Wall is using Continuous Collision Detection
Some other things to note that I don't think the matter is that the object's parent also has a RigidBody
.
Before this, I was using a RayCast
to move it out of the ground, but that was causing bugs when it went over inclines, and I would really like it to just work, but for some reason, the ball just goes through inclines, instead of going up them, even after everything else I've tried.
c# unity3d physics
Is it possible that your sphere of your sphere collider is just not exact enough?
– NtFreX
Nov 13 '18 at 8:24
I don't think so. At this point, I got it to move usingAddForce
every frame, and it hits walls, but it stops on the way up inclines, and I don't know why. I tried rotating the vector that's adding the force, but that didn't go the way I thought.
– AustinWBryan
Nov 13 '18 at 8:35
Maybe are you in the case in which the wall is thin and the sphere is moving too fast?
– Andrea
Nov 13 '18 at 9:49
How about Collision Layers?
– Morasiu
Nov 13 '18 at 10:12
Posting some code could be really helpful. Also, are you manually telling the ball to ignore certain layers?
– Immorality
Nov 13 '18 at 14:15
add a comment |
What I've tried and checked:
- Object has a non-trigger sphere collider
- Object has
RigidBody
- Object has very low mass
- Object is using Continuous Collision Detection
- I am adding a low force to the
RigidBody
atStart
, notUpdate
, instead of manually moving every frame - Wall has a non-trigger box collider
- Wall has
RigidBody
- Wall is using Continuous Collision Detection
Some other things to note that I don't think the matter is that the object's parent also has a RigidBody
.
Before this, I was using a RayCast
to move it out of the ground, but that was causing bugs when it went over inclines, and I would really like it to just work, but for some reason, the ball just goes through inclines, instead of going up them, even after everything else I've tried.
c# unity3d physics
What I've tried and checked:
- Object has a non-trigger sphere collider
- Object has
RigidBody
- Object has very low mass
- Object is using Continuous Collision Detection
- I am adding a low force to the
RigidBody
atStart
, notUpdate
, instead of manually moving every frame - Wall has a non-trigger box collider
- Wall has
RigidBody
- Wall is using Continuous Collision Detection
Some other things to note that I don't think the matter is that the object's parent also has a RigidBody
.
Before this, I was using a RayCast
to move it out of the ground, but that was causing bugs when it went over inclines, and I would really like it to just work, but for some reason, the ball just goes through inclines, instead of going up them, even after everything else I've tried.
c# unity3d physics
c# unity3d physics
edited Nov 13 '18 at 7:22
Elham Esmaeeli
798
798
asked Nov 13 '18 at 7:15
AustinWBryanAustinWBryan
2,33621332
2,33621332
Is it possible that your sphere of your sphere collider is just not exact enough?
– NtFreX
Nov 13 '18 at 8:24
I don't think so. At this point, I got it to move usingAddForce
every frame, and it hits walls, but it stops on the way up inclines, and I don't know why. I tried rotating the vector that's adding the force, but that didn't go the way I thought.
– AustinWBryan
Nov 13 '18 at 8:35
Maybe are you in the case in which the wall is thin and the sphere is moving too fast?
– Andrea
Nov 13 '18 at 9:49
How about Collision Layers?
– Morasiu
Nov 13 '18 at 10:12
Posting some code could be really helpful. Also, are you manually telling the ball to ignore certain layers?
– Immorality
Nov 13 '18 at 14:15
add a comment |
Is it possible that your sphere of your sphere collider is just not exact enough?
– NtFreX
Nov 13 '18 at 8:24
I don't think so. At this point, I got it to move usingAddForce
every frame, and it hits walls, but it stops on the way up inclines, and I don't know why. I tried rotating the vector that's adding the force, but that didn't go the way I thought.
– AustinWBryan
Nov 13 '18 at 8:35
Maybe are you in the case in which the wall is thin and the sphere is moving too fast?
– Andrea
Nov 13 '18 at 9:49
How about Collision Layers?
– Morasiu
Nov 13 '18 at 10:12
Posting some code could be really helpful. Also, are you manually telling the ball to ignore certain layers?
– Immorality
Nov 13 '18 at 14:15
Is it possible that your sphere of your sphere collider is just not exact enough?
– NtFreX
Nov 13 '18 at 8:24
Is it possible that your sphere of your sphere collider is just not exact enough?
– NtFreX
Nov 13 '18 at 8:24
I don't think so. At this point, I got it to move using
AddForce
every frame, and it hits walls, but it stops on the way up inclines, and I don't know why. I tried rotating the vector that's adding the force, but that didn't go the way I thought.– AustinWBryan
Nov 13 '18 at 8:35
I don't think so. At this point, I got it to move using
AddForce
every frame, and it hits walls, but it stops on the way up inclines, and I don't know why. I tried rotating the vector that's adding the force, but that didn't go the way I thought.– AustinWBryan
Nov 13 '18 at 8:35
Maybe are you in the case in which the wall is thin and the sphere is moving too fast?
– Andrea
Nov 13 '18 at 9:49
Maybe are you in the case in which the wall is thin and the sphere is moving too fast?
– Andrea
Nov 13 '18 at 9:49
How about Collision Layers?
– Morasiu
Nov 13 '18 at 10:12
How about Collision Layers?
– Morasiu
Nov 13 '18 at 10:12
Posting some code could be really helpful. Also, are you manually telling the ball to ignore certain layers?
– Immorality
Nov 13 '18 at 14:15
Posting some code could be really helpful. Also, are you manually telling the ball to ignore certain layers?
– Immorality
Nov 13 '18 at 14:15
add a comment |
1 Answer
1
active
oldest
votes
~Try this:
in Rigidbody properties, try to change Collision Detection to Continuous instead of discrete. Let me know if that helps.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53275713%2funity-object-going-through-wall%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
~Try this:
in Rigidbody properties, try to change Collision Detection to Continuous instead of discrete. Let me know if that helps.
add a comment |
~Try this:
in Rigidbody properties, try to change Collision Detection to Continuous instead of discrete. Let me know if that helps.
add a comment |
~Try this:
in Rigidbody properties, try to change Collision Detection to Continuous instead of discrete. Let me know if that helps.
~Try this:
in Rigidbody properties, try to change Collision Detection to Continuous instead of discrete. Let me know if that helps.
answered Nov 13 '18 at 10:21
DrDevDrDev
45427
45427
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53275713%2funity-object-going-through-wall%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is it possible that your sphere of your sphere collider is just not exact enough?
– NtFreX
Nov 13 '18 at 8:24
I don't think so. At this point, I got it to move using
AddForce
every frame, and it hits walls, but it stops on the way up inclines, and I don't know why. I tried rotating the vector that's adding the force, but that didn't go the way I thought.– AustinWBryan
Nov 13 '18 at 8:35
Maybe are you in the case in which the wall is thin and the sphere is moving too fast?
– Andrea
Nov 13 '18 at 9:49
How about Collision Layers?
– Morasiu
Nov 13 '18 at 10:12
Posting some code could be really helpful. Also, are you manually telling the ball to ignore certain layers?
– Immorality
Nov 13 '18 at 14:15