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

engineRequestModel does not work for physical objects #3074

Open
1 task done
borsuczyna opened this issue Jun 18, 2023 · 1 comment
Open
1 task done

engineRequestModel does not work for physical objects #3074

borsuczyna opened this issue Jun 18, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@borsuczyna
Copy link

Describe the bug

When engineRequestModel('object') is used with a parent object with physical properties it doesn't copy its physical properties (not only engineGetModelPhysicalPropertiesGroup and engineGetObjectGroupPhysicalProperty!!), for example, when velocity is applied to object with requested model, it will fall through the ground.

Important note, when

local parentGroup = engineGetObjectGroupPhysicalProperty(parentModel)
engineSetObjectGroupPhysicalProperty(model, parentGroup)

used, it won't have any physical properties at all

Steps to reproduce

local model = engineRequestModel('object', 1252)

function velocityOnStreamIn()
    setElementVelocity(source, 0.1, 0, 0)
end

addCommandHandler('testme', function()
    local x, y, z = getElementPosition(localPlayer)
    local o1 = createObject(1252, x + 2, y, z)
    local o2 = createObject(model, x + 2, y + 2, z)
    addEventHandler('onClientElementStreamIn', o1, velocityOnStreamIn)
    addEventHandler('onClientElementStreamIn', o2, velocityOnStreamIn)
end)

Version

Client: v1.6.0-release-21852(Windows 10, 64-bit)

Additional context

preview
https://i.imgur.com/4xrHQuU.gif

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@borsuczyna borsuczyna added the bug Something isn't working label Jun 18, 2023
@Xenius97
Copy link
Contributor

Similar to #1861

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

2 participants