How could do a cinimatic view in game while players choose there teams. Just have it playing in the background doing a loop, for example in gmod tower in minigolf on each hole the minigolf scores would come up and in the background the camera would be smoothly moving around the level.
Do you know lua?
I do the only way i can come up with is spectating an invisible entity and moving the entity around the map but i feel like there is a better way.
Well, you could always create a small entity, make it invisible, make a table of positions and use
LerpVector to alter the entities position(s).
LERP stands for linear-interpolation and can be used to create smooth transitions if done correctly.
This video might have some significance (https://www.youtube.com/watch?v=OeXt3WknAoA), but this uses LERP as one value (width), however LerpVector uses them as 3 (X, Y, Z)
so i’ve done that but it instantly goes from point a-b even using frametime in the Think() function i assume its because its running so quickly?
essentially this is my code right now
function GM:Think() local wm = ents.FindByClass("camfollow") wm:SetPos( LerpVector(10 * FrameTime(), camtable.pos, camtable.pos)) end
I assume this is probably because it’s happening on the server and not the client, therfore FrameTime will always display the max.
Try something like 0.1, 0.2, 0.3, etc instead of 10 * FrameTime(), and try without FrameTime() at all.
same thing should i do it clientside instead?
hmm, I was able to do it with this (shared lua/autorun):
local _ENDPOS = Vector( -650, -630, 160 ) local _STARTPOS = Vector( -5443, -664,209 ) local smoothFloat = 1 hook.Add( "Think", "KappaJ.debug.Think.lerptest", function() smoothFloat = Lerp( FrameTime() / _TIMETOTAKE, smoothFloat, 0 ) _ENDPOS = LerpVector( smoothFloat, _STARTPOS, _ENDPOS ) _ENT:SetPos( _ENDPOS ) end)
Thanks that worked perfectly