You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I need to achieve that the Viewmodel moves that the camera would be exactly in place of the AimPoint
- What is the issue? Include screenshots / videos if possible!
The video shows what is happening at the moment
local CURRENT_CAMERA_cf = CAMERA.CFrame
local WEAPON_cf_MULTIPLIERS = CurrSettings.CFrames
local WEAPON_AIMPOINT_cf = CurrSettings.AimPoint.CFrame or cf.new(0,0,0)--
local MULTIPLED = WEAPON_cf_MULTIPLIERS.ViewmodelMultiplier*WEAPON_cf_MULTIPLIERS.WeaponGripMultiplier
local AIM_DIST = WEAPON_AIMPOINT_cf:ToObjectSpace(CURRENT_CAMERA_cf)
local AIM_OFFSET = cf.new(AIM_DIST.X,AIM_DIST.Y,AIM_DIST.Z)
if IsAiming then
_CoreAndAimcf = _CoreAndAimcf:Lerp(
AIM_OFFSET,
DELTA_TIME*15
)
else
_CoreAndAimcf = _CoreAndAimcf:Lerp(
_Corecf,
DELTA_TIME*8
)
end
PointViewmodel(
CURRENT_CAMERA_cf --/ Fixated cf - camera
*_CoreAndAimcf --/ multiplier - aim
--*MULTIPLED --/ advanced multipliers
)
A piece of code responsible for positioning
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I found an exactly similar post on DevForum from @serialeater (How do you make aiming on a viewmodel gun?), and his problem was solved. I repeated all the steps to solve his problem, but the end result was not successful.
Ill be grateful for any help, the main thing is that it works!