Position offset

I haven’t ever used the actual Region3s made by roblox. I use the SpooksHD version that works with rotated parts.

And the positioning issue probably hasn’t anything to do with Region3.

It might be because the fireball itself is way too fast?

1 Like

Did you slow down the fireball? Like stop it?

1 Like

Yes, it gets anchored after it hits a part considered solid by the function mentioned above.

1 Like

Probably not! Try using this

 local weld = Instance.new("Weld", hitbox)
                    weld.Part0, weld.Part1, weld.C0, weld.C1 = weld.Parent, part, weld.Parent.CFrame, part.CFrame

instead of this

 local weld = Instance.new("Weld", hitbox)
                    weld.Part0 = weld.Parent
                    weld.Part1 = part

what method do you use to move it?
(If a part is anchored you can still edit it’s position using part.Position, therefore if you used that anchoring it would be ineffective)

1 Like

I use bodyvelocity to move the fireball

1 Like

Ok, that should work fine then :thinking:

1 Like

Just tried and it seems that the problem keeps occuring. Slowing down the fireball helps but it has to be slowed down by a lot.

1 Like

The only thing I can think of is changing this line

hitbox.Position = part.Position

to this

hitbox.CFrame = CFrame.new(part.Position)

Quick idea loop it,

for i=1,100 do
hitbox.Position = part.Position
end
1 Like

That’s not a good idea, actually.

That’s going to set the position of the hitbox to the part’s position 100 times.

I never said it was, i said it was quick, besides if slowing it down helps trying to loop it would be an idea to see if it’s centered around the centre axis.

1 Like

Same thing happens. Considering the fact that it gets somewhat fixed if the fireball is slower makes me think that it’s because of roblox’s physics engine. The part is moving way too fast for roblox to determine the exact position in space?

1 Like

Oh, alright! I didn’t think of that.

No that shouldn’t effect it since roblox code usually runs each frame (If the player has a client with enough RAM to store the memory that is inputted)

1 Like

The only thing remaining is to do RayCasting and tweening the part to the hit position and if the fireball hits anything, the hitbox’s position is set to the hit position.

This also suggests, that, the axis of position is centred at an offset of the true centre of the sphere which is a problem in your case.

1 Like