- Home /
Freeze object rotation on Polybrush
Hey, I wan't to use polybrush to draw a forest on a terrain. I wan't that the prefabs rotation of the prefab I dragged into the prefab brush is set to 0, 0, 0.
It is rotating the object based on the ground, but I want it to be completely vertical all the time. I tried to use use the checkbox "use pivot" but that doesn't change anything.
How can I archive that?
Answer by Makuza · Jun 13, 2020 at 12:04 PM
I had the same problem and modified polybrush to do that. What I did was go into BrushModePrefab.cs and on line 267 change:
Quaternion rotation = Quaternion.FromToRotation(Vector3.up, target.transform.TransformDirection(rand_hit.normal));
to: Quaternion rotation = Quaternion.identity;
Just comment the original out so you can go back.
Your answer
Follow this Question
Related Questions
How do I rotate in the center after changing the position of the pivot? 1 Answer
How do you change the pivot point of a group? 1 Answer
Physics related rotation problem. (a weird one) 0 Answers
Can I set a custom pivot point for an empty GameObject? 1 Answer
The bullet only moves in one direction and does not rotate with object. Code: 1 Answer