Elia171
(poggers)
June 9, 2020, 11:13am
#1
Hello ! I’m trying to simulate the behaviour of a billboard towards a player, but I have no idea how to capture exactly where the player is looking.
I have thought about using the TweenService, but in my opinion would not be a good idea and more a workaround.
Let’s imagine we have a variable orientationGoal(which will be the player Orientation) in a localscript
local orientationGoal = ?
But, I would like to make it smooth, with an equation
No w,we can have another variable that will be the current orientation of the part
local capturedOrientation = ?
The objective is to update every render this variable, using a simple RenderStepped event
I was imagining a lot but I don’t know really how to make this, help would be appreciated !
Quwanterz
(Quwanterz)
June 9, 2020, 11:14am
#2
Why would you want to simulate it when you can just use the Billboard GUI? Are there things that the Billboard GUI can’t do to your own project?
Elia171
(poggers)
June 9, 2020, 11:16am
#3
Well, good question !
A billboard gui doesn’t have a smooth movement, since having that type of movement is the goal
Quwanterz
(Quwanterz)
June 9, 2020, 11:16am
#4
What do you mean by not having smooth movement? Can you provide a video on what you are trying to achieve?
Elia171
(poggers)
June 9, 2020, 11:24am
#5
Well, I don’t know really how to explain…
In that video, the orientation of the billboard obviously changes, but it’s linear !
My objective is to make a part following the player camera orientation(like billboard guis) in a resonable speed but it’s smooth movement should be visible
I guess you could try making the part face the camera?
Just use tween service, heres a code on how to make the part face the camera
local camera = workspace.CurrentCamera
part.CFrame = CFrame.new(part.Position,camera.CFrame.Position)
I know its deprecated but it wont stop working anytime soon.
1 Like
Elia171
(poggers)
June 9, 2020, 12:39pm
#7
Hello, I used another method for that smooth movement
Looks sexy by the way !
But I’m having another problem, and I can’t really solve something despite its simplicity
How can I lock the movement only the Y axis ? (green as indicated on the screenshot)
Here’s my goal variable:
Check out the solution, its like a whole new method
workspace.Example.CFrame = CFrame.new(workspace.Example.Position,Vector3.new(workspace.Example.Position.X,pos.Y,workspace.Example.Position.Z))
Im trying to make the part go face the Y Axis of the mouse but its not working, the part wont rotate at all, I also tried
workspace.Example.CFrame = CFrame.new(workspace.Example.Position,Vector3.new(0,pos.Y,0))
But the parts X and Z axis becomes 0 which is ineffecient since I only want the Y Axis to change.
2 Likes
Elia171
(poggers)
June 9, 2020, 1:42pm
#9
That solution isn’t logic for my IQ, I must be idiot haha
Anyway thanks for your help!
1 Like