You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am unable to set properties of an "Effect" object through its member variables, however I can by using the class functions.
To reproduce:
Assigning a new matrix will not update the object's physical position or .position property, but will change the matrix property.
local fx = Effect.create("petrolcan", Vector3(0,0,0))
addEventHandler("onClientPreRender", root, function ()
local bone1 = localPlayer:getBonePosition(1)
fx.matrix=Matrix(bone1,Vector3(0,90,-localPlayer.rotation.z+90))
outputDebugString("Player z: " .. localPlayer.position.z .. " Effect z via .position: " .. fx.position.z .. " Effect z via .matrix property: " .. fx.matrix.position.z )
end
)
Result:
Result:
Setting the position member works, but does not update the object position. The matrix is not updated.
local fx = Effect.create("petrolcan", Vector3(0,0,0))
addEventHandler("onClientPreRender", root, function ()
local bone1 = localPlayer:getBonePosition(1)
fx.position = bone1
fx.rotation = Vector3(0,90,-localPlayer.rotation.z+90)
outputDebugString("Player z: " .. localPlayer.position.z .. " Effect z via .position: " .. fx.position.z .. " Effect z via .matrix property: " .. fx.matrix.position.z )
end
)
Result:
Expected behaviour:
Setting the position and rotation using the class functions works as intended. This behavior ought to work using the .matrix and .position members as it does with most objects.
local fx = Effect.create("petrolcan", Vector3(0,0,0))
addEventHandler("onClientPreRender", root, function ()
local bone1 = localPlayer:getBonePosition(1)
fx:setPosition(bone1)
fx:setRotation(Vector3(0,90,-localPlayer.rotation.z+90))
outputDebugString("Player z: " .. localPlayer.position.z .. " Effect z via .position: " .. fx.position.z .. " Effect z via .matrix property: " .. fx.matrix.position.z )
end
)
Version:
Tested on Multi Theft Auto v1.5.6-release-16705, tester on Discord ran all 3 scripts successfully using Multi Theft Auto v1.5.6-release-16614.
The text was updated successfully, but these errors were encountered:
Describe the bug
I am unable to set properties of an "Effect" object through its member variables, however I can by using the class functions.
To reproduce:
Assigning a new matrix will not update the object's physical position or .position property, but will change the matrix property.
Result:
Result:
Setting the position member works, but does not update the object position. The matrix is not updated.
Result:
Expected behaviour:
Setting the position and rotation using the class functions works as intended. This behavior ought to work using the .matrix and .position members as it does with most objects.
Version:
Tested on Multi Theft Auto v1.5.6-release-16705, tester on Discord ran all 3 scripts successfully using Multi Theft Auto v1.5.6-release-16614.
The text was updated successfully, but these errors were encountered: