Question by
qiqette · Mar 08, 2016 at 09:05 AM ·
scripting problemraycastchildtag
Why is It not casting any Ray? [Scripting Problem]
using UnityEngine;
using System.Collections;
public class PassLevel1 : MonoBehaviour {
GameObject[] GoodBlocks;
void Start()
{
GoodBlocks = GameObject.FindGameObjectsWithTag("Good");
foreach (GameObject good in GoodBlocks)
{
Transform goodPosition = good.GetComponentInChildren<Transform> ();
//Transform goodPosition = good.GetComponent<Transform)>();
Debug.DrawRay(transform.position, goodPosition.forward, Color.red);
}
}
As you can see on the Capture i have a Cube with his child, and the function should cast a ray from the cube to his child, but nothing is happening. I don't have any clue about what is my problem :(
captura.png
(44.3 kB)
Comment
Your answer
Follow this Question
Related Questions
Raycast get tag from spatial mapping collider 0 Answers
Making UI block rays with touch inputs 0 Answers
how do I call a function from another script, when Raycast Hits? 1 Answer
Raycasting is running in two different objects with the same Tag when I touch just one of them 1 Answer
Raycast objects with a tag C# 0 Answers