The problem is, in one of the scripts, i offset the camera by Y. And i want the arrows to fly where player’s mouse is, so he can aim better. But they fly lower than the cursor, because camera offset is set to +2 by Y.
This seemed to work at first, but gets broken once i approach any character, or any object, as you can see in the video
The arrow’s Can Collide is always false, and some of the objects Can Collide is true, some false, but the issue occurs with any object. It looks like it happens when mouse hit position is too close to player.
First use CFrame.lookAt(). Then tween the arrow to go to it’s look vector multiplied by the radius from the mouse position and arrow
Or with linear velocity set it to look straight to the mouse position and switch on its velocity then turn off its velocity once the radius is close enough.
Haven’t tried it yet, will try tomorrow, but i am 90% sure that the same issue would still occur, because this problem happens when mouse hit position is too close to player, so setting to look at mouse hit position would make the arrow again fly weird.
The solution can be to use something else instead of mouse.hit.position, but i dont know what.
And i don’t want to use tweens, since i will be doing other manipulations with projectiles too, and tweens would make them far too complicated
If you mean like the arrow going side ways instead of nailing to the ground its because of where the arrow spawned + where the mouse is aiming at(AKA the Instance its hovering onto), what you can do is instead of basing it on the arrow u can base it on the Rootpart Instead, I’m not sure if this will fix that problem thought and not sure if there’d be some aim inaccuracy.
local Speed = 200
local Mouse = game.Players.LocalPlayer:GetMouse()
arrow.AssemblyLinearVelocity = (Mouse.hit.Position - HRP.Position).Unit*Speed
local arrow = ...
local targetPosition = ...
``` a vector3 describing the direction to the target position
local direction = targetPosition - arrow.Position
-- change this ratio to any number you like to change the flight curve
local ratio = 200 / direction.Magnitude
-- if you want to know how long it will take the arrow you get to its target
-- local throwTime = 1 / ratio
-- work out the force using gravity so it hits perfectly
local force = direction * ratio + Vector3.new(0, game.Workspace.Gravity * 0.5 / ratio, 0)
-- set the arrows velocity
arrow.AssemblyLinearVelocity = force