Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setElementDimension doesn't work with colshapes #3855

Open
1 task done
derxgbb opened this issue Nov 13, 2024 · 0 comments
Open
1 task done

setElementDimension doesn't work with colshapes #3855

derxgbb opened this issue Nov 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@derxgbb
Copy link

derxgbb commented Nov 13, 2024

Describe the bug

Hello, the wiki says that setElementDimension works with colshapes but in reality it doesn't. (only partially)

Steps to reproduce

setDevelopmentMode(true)
local example = createColCircle(0, 0, 1)
setElementDimension(example, 1)

use /showcol 1 in F8
then change your dimension to any dimension than 1, you'll be able to see the colshape.
Not only see it, but it will trigger onClientColShapeHit / onClientColShapeLeave / onClientElementColShapeHit / onClientElementColShapeLeave / onColShapeHit / onColShapeLeave / onElementColShapeHit / onElementColShapeLeave

addEventHandler("onClientColShapeHit", example, function(theElement, matchingDimension)
end)

In the above code you can if-check the matchingDimension if it's the same as set with setElementDimension. So the function partially works with it but it isn't ideal.

for example, what if you would like to avoid using colshape hit and colshape leave events?
I have a script where I check if a player is inside a colshape and if yes, then I slowly change his/her position towards the edges to drag the player out.

addEventHandler("onClientRender", root, 
function() 
    if isElementWithinColShape(localPlayer, colshape) then
        --code for dragging the player out ...
    end
end)

I know I can use different approach for such things, I just noticed that when I change the player's dimension the code for the colshape still runs which is not ideal for me.

Another thing:
It would be cool, if these events onClientColShapeHit / onClientColShapeLeave / onClientElementColShapeHit / onClientElementColShapeLeave / onColShapeHit / onColShapeLeave / onElementColShapeHit / onElementColShapeLeave would have a number dimension and a number interior parameter to know which dimension and interior were triggered.

Version

all version

Additional context

No response

Relevant log output

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@derxgbb derxgbb added the bug Something isn't working label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant