ArtianSJoin Date: 2013-09-03 Post Count: 147 |
cf = workspace.CurrentCamera.CFrame.p
part.CFrame = CFrame.new (part.Position, Vector3.new (cf.X,
part.Position.Y, cf.Z))
I have tried most everything but nothing seems to work, am I missing a vital component to it working? If so, share details. |
|
|
ArtianSJoin Date: 2013-09-03 Post Count: 147 |
The script doesn't do anything when inside of a model, set up to my best efforts inside of a part. It did not do what I ad hoped it to do: following the player's camera without being flat in all angles, and rotating on the Y axis. Facing a flat 90 degree angle at all times, but following the player's camera. This script was provided by the maker of Cleaning Simulator, for the NPCs in the game. |
|
|
is it in a loop or fired on an event? |
|
LaedereJoin Date: 2013-06-17 Post Count: 23630 |
cf = workspace.CurrentCamera.CFrame.p
part.CFrame = CFrame.new (part.Position, cf)
|
|
ArtianSJoin Date: 2013-09-03 Post Count: 147 |
@system it's not fired on an event, and is meant to happen as soon as the server goes up
@lae I'm confused what to do with those. I've never scripted before, I'm mainly a builder. |
|
|
I would help if I wasn't so bad at this scripting |
|
|
well if it's not in a loop or constantly fired, then the CurrentCamera's CFrame will not be updated to the variable, and the part's CFrame won't get updated either, so it will just move one time
which I thought you wanted it to follow the camera? |
|
ArtianSJoin Date: 2013-09-03 Post Count: 147 |
Could you tell me how to loop it please? I'd ask the dev for more info, but I'd fear he's ignore me as he refuses to help me unless I know basic lua, which I don't. |
|
|
while condition do
--code
wait()
end |
|
|
if you're dealing with a part following a camera, though, I'd fire it on RenderStepped, as it would look much smoother and not need the wait() to prevent the game from crashing |
|
ArtianSJoin Date: 2013-09-03 Post Count: 147 |
Even looped, it's not working. Could you tell me about how to work with renderstepped? |
|
ArtianSJoin Date: 2013-09-03 Post Count: 147 |
I have an option to ask the developer for the entire thing, but I fear they would most likely think I want to take their script and use it as my own, and claim it, and thus is why they're keeping me in the blue. The problem here is that all of this is driving a simple minded builder like myself insane. |
|