playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
Rigidbody goes through wall/terrain
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Rigidbody goes through wall/terrain (Read 3152 times)
SawyerK
Junior Playmaker
Posts: 93
Rigidbody goes through wall/terrain
«
on:
January 19, 2020, 11:54:12 AM »
When i pick up a rigidbody (parenting to playercamera) i turn its gravity off and get its localposition then write it back every frame with setPosition to keep it in the parented position.I
don't
use isKinematic. The problem is the object still goes through walls and terrain. They have collision.
Logged
djaydino
Administrator
Hero Member
Posts: 7616
Re: Rigidbody goes through wall/terrain
«
Reply #1 on:
January 19, 2020, 01:09:09 PM »
Hi.
i am not sure what you mean, but when you disable gravity on a object its bets to do a set velocity right after you set gravity to 0
can you show a video or some images?
Logged
Join the PlayMaker Discord Channel!
SawyerK
Junior Playmaker
Posts: 93
Re: Rigidbody goes through wall/terrain
«
Reply #2 on:
January 19, 2020, 07:02:59 PM »
Sure. I do use setVelocity and setAngularVelocity, both set to 0 and i use getPosition and setPosition so the object stays in front of the camera, it looks like that the picked up object collides with the wall/ground when it touches it but it still goes through.
«
Last Edit: January 19, 2020, 07:06:24 PM by SawyerK
»
Logged
djaydino
Administrator
Hero Member
Posts: 7616
Re: Rigidbody goes through wall/terrain
«
Reply #3 on:
January 20, 2020, 03:57:55 AM »
Hi,
I did i quick google search and this might get you in the right direction :
https://answers.unity.com/questions/1195454/rotating-gameobject-not-colliding-1.html
Logged
Join the PlayMaker Discord Channel!
SawyerK
Junior Playmaker
Posts: 93
Re: Rigidbody goes through wall/terrain
«
Reply #4 on:
January 20, 2020, 08:13:53 AM »
Thanks, but it still goes through even if i use angularVelocity to rotate, i think the problem going to be the setPosition, but i dont know how to set the objects position withouth setPosition.
Logged
SawyerK
Junior Playmaker
Posts: 93
Re: Rigidbody goes through wall/terrain
«
Reply #5 on:
January 20, 2020, 08:32:08 AM »
I tried using moveTowards which works for bigger objects, but even that's not perfect smaller object like a handgun goes through wall/ground.
Logged
DanielThomas
Beta Group
Full Member
Posts: 150
Re: Rigidbody goes through wall/terrain
«
Reply #6 on:
January 20, 2020, 08:54:03 AM »
Since it's physics, make sure you're using Rigidbody set position.
Logged
Freelance Artist
Follow me on Twitter
SawyerK
Junior Playmaker
Posts: 93
Re: Rigidbody goes through wall/terrain
«
Reply #7 on:
January 20, 2020, 09:52:40 AM »
The rigidbody setPosition doesn't have a self "Space" it only uses world space.
Logged
DanielThomas
Beta Group
Full Member
Posts: 150
Re: Rigidbody goes through wall/terrain
«
Reply #8 on:
January 21, 2020, 05:16:23 AM »
If you want accurate physics emulation(which seems like your problem from initial post) you should use Rigidbody.
Logged
Freelance Artist
Follow me on Twitter
SawyerK
Junior Playmaker
Posts: 93
Re: Rigidbody goes through wall/terrain
«
Reply #9 on:
January 21, 2020, 09:10:49 AM »
It is a rigidbody.
Logged
DanielThomas
Beta Group
Full Member
Posts: 150
Re: Rigidbody goes through wall/terrain
«
Reply #10 on:
January 21, 2020, 11:53:54 AM »
I mean Rigidbody actions. This is the absolute first thing I would try considering using transform position doesn't use physics and can lead to things like colliders going through colliders.
Logged
Freelance Artist
Follow me on Twitter
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
Rigidbody goes through wall/terrain