Nope! 32 Collision Groups should be sufficient
Thank you for your reply minmay, your explanation was *precisely* what I was looking for
Muchly appreciated
Nope! 32 Collision Groups should be sufficient
Yup, sure is...
Code: Select all
GameObject:setWorldRotationAngles(x, y, z)
Code: Select all
GameObject:setWorldPositionY(y)
Code: Select all
startHeight = 1.0
dir = 0
posY = 0
function cubeAnimator()
local spinner = findEntity("akr_cube_block_1")
if posY < startHeight then
posY = posY + 0.001
spinner:setPosition(cubeAnimScript.x, cubeAnimScript.y, dir, posY, cubeAnimScript.level)
elseif posY >= startHeight then
dir = dir + 0.02 %4
posY = posY + 1.25 %.1
spinner:setPosition(cubeAnimScript.x, cubeAnimScript.y, dir, (math.sin(posY) * 0.05 + 0.7), cubeAnimScript.level)
end
end
Code: Select all
defineObject{
name = "akr_cube_block",
baseObject = "base_obstacle",
components = {
{
class = "Model",
model = "assets/models/items/vector_marker.fbx", --LoG1 cube boss shell
staticShadow = true,
},
{
class = "Timer",
name = "spintimer",
timerInterval = 0.1, --this is actually less than every frame
triggerOnStart = true,
onActivate = function(self)
cubeAnimScript.script.cubeAnimator()
end,
},
},
}
Everyone started at 0 modding knowledge
A couple problems with the code you posted here:
It's not. You would have to call setWorldPosition()/setWorldRotation()/setWorldRotationAngles()/etc. many thousands of times per frame for it to become a problem. You should just leave the timerInterval at 0 (which makes it always trigger once per frame).
Yup! My error, mix up in translation
Ahhh I didnt know how to deal w that framerate issue yet, thanks!
Ok, same dealio - Timer (interval set to 0) onActivate hook connected to a Script with the following:
Code: Select all
manAnim_X = 0
manAnim_Y = 0
-----------------
function manualObjectAnimator()
local cageObject = findEntity("prison_cage_1")
local dT = Time.deltaTime()
manAnim_X = manAnim_X + 1 % 360 * dT
manAnim_Y = manAnim_Y + 0.25 % .1 * dT
--TILT
cageObject:setWorldRotationAngles(0, 10, 0)
--ROTATE
cageObject:setPosition(cageObject.x, cageObject.y, manAnim_X, (math.sin(manAnim_Y) * 0.02 + 0.1) * dT, cageObject.level)
end