It could even be X but I'm not too sure, I'm trying to get a part to look at another position using BodyGyro.CFrame.

local xPos2 = math.random(-spawnPart.Size.X/2, spawnPart.Size.X/2)
ocal zPos2 = math.random(-spawnPart.Size.Z/2, spawnPart.Size.Z/2)
local newPos = Vector3.new(xPos2, yPos, zPos2)
Data["NPC"].Driver.BodyGyro.CFrame = CFrame.new(Data["NPC"].Driver.Position, spawnPart.Position + newPos)

yPos is the model's height / 2, which is also where the BodyPosition is, the problem I have here is that the Model which contains a part that holds the BodyGyro and Position looks slightly up, at the smallest angle, but it's awfully annoying, I tried to convert newPos into a CFrame by:

BodyGyro.CFrame = CFrame.new(newPos) -- a vector3 value.

But this also doesn't seem to work, the models look all in the same direction suggesting that the value is nil. Is there a way so that the Y segment of the BodyGryo is unaffected? Just the looking of left and right?

2 comments

0

Set the Y component of the BodyGyro CFrame to the part’s Y Cframe?

0

Nope doesn't seem to work, it's relative to "spawnPart", thanks anyways.