Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: SawyerK 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.
-
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?
-
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. :D
(https://i.postimg.cc/rpsf5hCj/gtw1.jpg)
(https://i.postimg.cc/LsWNDzxp/gtw2.jpg)
(https://i.postimg.cc/HnD3DTGv/gtw3.jpg)
(https://i.postimg.cc/3RD9cdqD/gtw4.jpg)
(https://i.postimg.cc/j2HcRBtx/gtw5.jpg)
-
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
-
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.
-
I tried using moveTowards which works for bigger objects, but even that's not perfect smaller object like a handgun goes through wall/ground.
-
Since it's physics, make sure you're using Rigidbody set position.
-
The rigidbody setPosition doesn't have a self "Space" it only uses world space.
-
If you want accurate physics emulation(which seems like your problem from initial post) you should use Rigidbody.
-
It is a rigidbody.
-
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.