ServerScriptService.RotatedRegion3.Vertices:176: attempt to call a nil value - Server - Vertices:176

Basically the whole issue is that the module will not acknowledge the hitbox as apart of the module so it just stays there and make my character stuck.

What I’m saying is that the error I get is making my Hitbox not get acknowledged as a Region3 part.

image

https://gyazo.com/7de990afdb03ffd056ddf1cd33f7b94a)

Hopefully it’ll be the last issue I gotta deal with before I finish this combat.

The general problem I want to get past the current moment is hopefully being able to make the hitbox get acknowledged as a Region3 part so I’ll be able to move once I finish the hit. Due to me being unable to move after doing the hit atm.


local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")

--\\ Variables //--

local Debounce = false

local Count = 1

local HB = game.ReplicatedStorage.Hitbox

--\\ Modules //--

RR3 = require(game.ServerScriptService.RotatedRegion3)

--\\ Functions //--

script.Parent.OnServerEvent:Connect(function(Player, Action)

	local Character = Player.Character

	if Action == ("Combat") then 
		local Hitbox = HB:Clone()
		Hitbox.CFrame = Character.PrimaryPart.CFrame * CFrame.new(0,0,-3)
		local Weld = Instance.new("WeldConstraint", Character.PrimaryPart)
		Weld.Part0 = Hitbox
		Weld.Part1 = Character.PrimaryPart
		Hitbox.Parent = workspace
		RR3:FromPart(Hitbox)

		Debris:AddItem(Hitbox, .3)    
	end

end)

The new combat is looking more like this now. (Script wise)

1 Like

Hey there. :wave:

Please provide more information so we can more easily brainstorm solutions. Thanks!

What information might be lacking you would believe can help?

Hey there. :wave:
You haven’t described what exactly the error is, and what your intention is for the end product. Also, we haven’t been given an idea of how the script is setup, or other pieces of information that could possibly cause the error.

Also, assuming you are using EgoMoose’s “Rotated Region3 GJK” module, I think you need to use “.” instead of “:” when calling “RR3.FromPart”. For example:

-- Try to replace the following block of code,
RR3:FromPart(Hitbox)
-- with the given block of code below
RR3.FromPart(Hitbox)

Hope this helps! :smiley:

I feel kind of ashamed, that’s all there was. Thank you man.

Hey there. :wave:
Of course, happy to help. Also, no worries haha, it’s a pretty common mistake for me as well. :joy:

Have a wonderful day! :wave:

1 Like

To add onto this when you call the instance method “FromPart” through an instance with use of the colon operator like RR3:FromPart(Hitbox) the object “RR3” is implicitly passed as the first argument to the function. However when you call the module function with the dot operator like RR3.FromPart(Hitbox) this then the object through which the function is called is not implicitly passed as an argument to the function, in this case only the explicitly declared argument “Hitbox” is passed.

2 Likes