Hello. I’m working on a track game and I am wanting to implement a Side Camera so you can also look at other racers to see how close/far they are from you. But I don’t really see I could do it. I want to reference a game called “Speed Stars” For this Idea.
Idk if you can tell but the camera is like rotating along with the track
You could set the CameraType to Scriptable and constantly update the cameras CFrame with: CFrame.new(pos: Vector3, lookAt: Vector3)
Where pos is the position of the players head, but 10 studs to the right. (Use CFrame.RightVector of the players head and multiply it by 10)
And where lookAt is just the position of the players head.
(Edit: This assumes you know how to script to make the player only run on the track)
I am not too familiar with MoveTo() but from what i could read, it seems like the perfect solution. Btw, i tried to test my idea of updating the camera relative to the characters head, and realized i didn’t think about the head wobble when running. This means the camera swings around, which i assume is not ideal… I will update you again if i find a better solution
Yes, that’s possible, but it would still wobble a little bit on the XZ plane. However, i luckily just found out that you could just switch out head with the HumanoidRootPart and it automatically is stabilizes all axes:
local player = game.Players.LocalPlayer
local camera = workspace:WaitForChild("Camera")
camera.CameraType = Enum.CameraType.Scriptable
while task.wait() do
local character = player.Character
if character then
local rootPart = character:FindFirstChild("HumanoidRootPart")
if rootPart then
local cameraDistanceToPlayer = 10
local rightVector = rootPart.CFrame.RightVector * cameraDistanceToPlayer
local upVector = Vector3.yAxis * 3
local newPosition = rootPart.Position + rightVector + upVector
camera.CFrame = CFrame.new(newPosition, rootPart.Position)
end
end
end
If you copy paste that into a localscript in StarterPlayerScripts, you can test it out.
Note: Here you can also adjust the height of the camera by adjusting 3 in: local upVector = Vector3.yAxis * 3
Yes i think you could have a bunch of invisible ball parts along the edges of the track, whereas the player keeps moving toward the next balls position. How you would determine which ball is next, might also be a challenge. Perhaps you could have all the balls named after numbers and keep updating a variable with the players latest touched ball. And with that you could just get the next ball by incrementing the number of the latest touched ball. (idk if that makes sense )
Ah I’m sorry, i don’t want to talk, but you can message me if you want. I see you have a discord set with RoPro, I’ll just send a message and you’ll know it’s me.