CheeseSevan
(CheeseSevan)
#1
So far i got no idea how to start, and i really need help on this
if i spawn it here, it will face this side beacuse of no changes
but if it is on the other side and no changes, it won’t look at the block
i know i could use look at, but it won’t snap like 90 degrees, i want to detect the face the is the closest
You still can use LookAt in this case! If you get the LookAt CFrame, then:
- Split it into the X, Y, Z orientations.
- Divide the X Y Z values by 90
- Use
math.round()
on the X Y Z values
- Multiply the new values by 90 and set the orientation to them.
It should snap the orientation to the 90 degrees.
CheeseSevan
(CheeseSevan)
#3
What about if it is not only at the 90 degree?
edit: forgot that you said divide by 90 and 180 divided by 90 its 2 and 2 times 90 is 180 so if it was supposed to be 180 it will round to 2
system
(system)
Closed
#4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.