- Home /
Use OnTriggerEnter during a transform !
Hi guys !
I've been looking for a solution for over a week, here's my problem:
I'm creating a small city builder, so I've made a selection of buildings that we can then place on the map.
To do this, I do a raycast to get the position of the mouse in my map (which I call "hit"). And I move the building (Actual_Building) to this position: Actual_Building.transform.position = new Vector3 (Mathf.Round(hit.point.x), Actual_y, Mathf.Round(hit.point.z));
(Actual_y = 1)
My ground (of the map) is composed of squares/case which all have a trigger, the goal is to check if the ground is constructible or not.
The problem is that the triggers don't work when I move my building. I have tried by fallen the building on the map with a RigidBody and the triggers work well...
Here's the thing... If you have a solution :)
Thanks in advance !!!!
Your answer
Follow this Question
Related Questions
Following Terrain Height? 2 Answers
Continuous RayCast on GetButtonDown 0 Answers
Trigger move object only when player isn't looking at object 1 Answer
I am trying to allow the player to pick up and move objects in a FPS style game 0 Answers
Receiving information about getting hit by a Raycast 2 Answers