When I saw this had been updated twice, I did a little happy dance in my head, especially when I noticed easing styles were added. However, when I implemented the new module, I got this error on line 197:
path.DynamicCrosshair:197: attempt to index nil with 'spread'`
It’s coming from the :SmoothSet() function in the module. I made 100% sure by removing :SmoothSet() from my code, and it didn’t return an error.
You can try to accomplish this by possibly using DynamicCrosshair’s :Display() function? Seems like kind of a stretch so maybe a built-in function that does this exact thing can be seen in a future update.
That documentation is outdated to my knowledge, which is at the top of my to-do list to update.
Maybe create a separate website for documentation? If it’s a good idea ~
I’ll reply as soon as I can with a fix or patch for the module!
As always, if you run into any problems with the website or module respond to this post or reach out to me on my socials (located on the documentation website)
Hello, I am currently experiencing a problem related to :Raycast().
I’m not sure if it’s my coding or the module itself, but the direction it returns is inaccurate. I made sure of blacklisting character itself from the raycast, and followed the documentation well, but unfortunately, the problem still persists.
If needed, here is how my code looks like.
function FireProjectile()
local VIEWPORT_SIZE = Camera.ViewportSize
local CAST_LENGTH = Tool:GetAttribute("BulletMaxDist")
raycastParams.FilterDescendantsInstances = {Character, IgnoreList}
local _, direction = DynamicCrosshair:Raycast()
local unitRay = Camera:ScreenPointToRay(VIEWPORT_SIZE.X / 2, VIEWPORT_SIZE.Y / 2 - game:GetService("GuiService"):GetGuiInset().Y)
local raycastResult = workspace:Raycast(unitRay.Origin, direction * CAST_LENGTH, raycastParams)
local TargetPosition = if raycastResult then raycastResult.Position else unitRay.Origin + direction * CAST_LENGTH
if not isInSafeMode then
MouseEvent:FireServer(TargetPosition)
end
if RoxiteSettings.Debug then
local Line, Cone = Gizmo:DrawArrow(unitRay.Origin, TargetPosition, Color3.fromRGB(85, 186, 255))
game:GetService("Debris"):AddItem(Line, 5)
game:GetService("Debris"):AddItem(Cone, 5)
end
end
Hmm, interesting, it could possibly be because of the Camera:ScreenPointToRay you use in your code, since DynamicCrosshair already does that for you, but I doubt it.
I’d say try it without it and see if anything changes.
try this
function FireProjectile()
local CAST_LENGTH = Tool:GetAttribute("BulletMaxDist")
raycastParams.FilterDescendantsInstances = {Character, IgnoreList}
local origin, direction = DynamicCrosshair:Raycast()
local raycastResult = workspace:Raycast(origin, direction * CAST_LENGTH, raycastParams)
local TargetPosition = if raycastResult then raycastResult.Position else origin + direction * CAST_LENGTH
if not isInSafeMode then
MouseEvent:FireServer(TargetPosition)
end
if RoxiteSettings.Debug then
local Line, Cone = Gizmo:DrawArrow(origin, TargetPosition, Color3.fromRGB(85, 186, 255))
game:GetService("Debris"):AddItem(Line, 5)
game:GetService("Debris"):AddItem(Cone, 5)
end
end
If the problem persists could you send a Roblox file so I can take a look myself? My socials are all on the documentation website!
Image crosshairs are pretty self-explanatory. They are single-image crosshairs that are as big as a normal crosshair would be. They work with all built-in functions.
Once the image crosshair is enabled all other crosshairs are disabled. The center dot will still exist.
The function :Size can take 1 argument instead of 2.
Example:
-- DynamicCrosshair size is (5, 1)
DynamicCrosshair:Size(10) -- size will result in (10,1)
DynamicCrosshair:Size(10,10) -- size will result in (10,10)
Statuses:
Documentation is not updated (stay tuned)
Module is updated
As always, if you run into any problems with the website or module respond to this post or reach out to me on my socials (located on the documentation website)
also smooth set now doesn’t tween whenever i try to use it and uses default set, Do i need to use some functions in order to make it work or missing something here?
What seems to be a small mistake in the documentation thanks for pointing that out
Now for your :SmoothSet(), you have the seconds parameter set to 0 meaning it won’t have the “bounce/smooth effect”. To change this just set this to seconds parameter to something to your liking such as
-- :SmoothSet(spread, seconds, updateMin)
:SmoothSet(60, 1) -- will take 1 second to "bouncingly " set
If you have any other problems or this doesn’t work for you reply to this message!
could you shoot me a private message so we could further talk about this? Possibly with a place file and make sure the module is updated. Sorry for the inconvenience