It seems to work when I put Physics2D.Linecast in "Update" as opposed to "FixedUpdate"... I always thought that physics related functions should only be used with with FixedUpdate. Oh well it works now!
Linecast not working after Instantiation of a particular object
Hey guys, I am having an issue with an enemy using Linecast to detect the player. If i put him in the scene before runtime, he detects the player and acts according, but when I use a pool to instantiate him, he ignores the player and the boolean associated with the Linecast never evaluates to true. Just another note, when he is instantiated via the Pooler script he starts as inactive until he is needed. Any suggestions?..
Update Turns out if I put him in the scene as Inactive before runtime, I encounter the same issue, but when he is already active he works fine.
Follow this Question
Related Questions
How can I check a Linecast across multiple layers, and assign the result to a single bool? 1 Answer
Physics2D.Linecast unreliable with Rigidbody2D interpolation? What to do 1 Answer
Building a Face Generator, need to destroy previous instance after pressing key a second time 0 Answers
Error 0029 1 Answer
Randomizing and using Bool values 0 Answers