- Home /
Changing the direction of a prefab when colliding with an object
Hey Guys i am just starting in unity and I am trying to ake a 2D Puzzle game. And i want to make an Object (triangle) that changes the direction of the bullet in 90 degree angle.SO in my Bullet Controller Script I made a Enum Called Direction Holding FOur values {Up,Down,Left,Right} and the Made A varible called my direction of type DIrection.SO that i can Access the direction with myDirection.UP or left... and then make an if statement the changes the direction and so on. but my question is how can i acces that myDirection variable and change it in my triangle script when the BUllet (prefab) and the triangle are colliding. sorry if my question wasn't and thank if you can't find a solution Bye
if the variable is public and the class too you can access the property by the class className.myDirection.UP
Your answer
Follow this Question
Related Questions
Issues with instantiated prefabs 1 Answer
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer