Question by
alfredoro000 · Nov 30, 2019 at 06:49 PM ·
gameobjectrigidbodyraycast
Raycast affecting rigid body player
When I use Raycast , it push away my player game object, it has a rigid body. How can I fix it? I need to keep the rigid body component but I don't want the Raycast pushes my Player RaycastHit hit;
if(Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, Mathf.Infinity))
{
if (hit.transform.CompareTag("Player"))
{
Debug.Log("I see you");
}
else if (hit.transform.CompareTag("Plataforms"))
{
Debug.Log("Shit");
}
}
Comment
Your answer
Follow this Question
Related Questions
Ragdoll won't recieve damage from raycast gun, or allow move code, or deactivate 0 Answers
[SOLVED] Cannot AddForce to instantiated game object. 1 Answer
my cow object sinking through ground? 0 Answers
DESPERATE How to align transform.up with another vector3 (direction) ? 1 Answer
How do you make a realistic scoping/aiming system in Unity?? 0 Answers