Closed Gavinator96 closed 2 years ago
Swap the first two strings in your tween, you're supposed to give your tween a tag first (any will do) and then type what object you want to tween, in this case it's 'Pendelum' (you typed the image file for the sprite instead)
It should look like this
doTweenAngle('swing', 'Pendelum', angle, duration, 'easeInOut')
Then if you want to continue tweening it you'll either need to create a loop or use stuff like song position, BPM, etc
I'm guessing you're doing something like Lullaby so you can just look at the source code to get a better idea
Swap the first two strings in your tween, you're supposed to give your tween a tag first (any will do) and then type what object you want to tween, in this case it's 'Pendelum' (you typed the image file for the sprite instead) It should look like this
doTweenAngle('swing', 'Pendelum', angle, duration, 'easeInOut')
Then if you want to continue tweening it you'll either need to create a loop or use stuff like song position, BPM, etc I'm guessing you're doing something like Lullaby so you can just look at the source code to get a better idea
the 'Pendelum' part is the tag the 'Pendelum thing' is the image file
You tween an object, not an image file
also i dont know how to use stuff like song position or bpm or whatever and btw i also well dont know how to see source code, im on the lua build
You tween an object, not an image file
then do i tween the tag that i gave the image
You use source code as reference, it's public and helps a lot
You use source code as reference, it's public and helps a lot
well i dont know where to find the source code for it
✨✨Google✨✨ it's literally in the mod's gamebanana page
ok well i dont know what to do with the source code
You read it and you translate it into Lua code
ok
Swap the first two strings in your tween, you're supposed to give your tween a tag first (any will do) and then type what object you want to tween, in this case it's 'Pendelum' (you typed the image file for the sprite instead) It should look like this
doTweenAngle('swing', 'Pendelum', angle, duration, 'easeInOut')
Then if you want to continue tweening it you'll either need to create a loop or use stuff like song position, BPM, etc I'm guessing you're doing something like Lullaby so you can just look at the source code to get a better idea
also btw when i did this it just did this
✨✨Google✨✨ it's literally in the mod's gamebanana page
also the gamebanana page for what? psych engine or lullaby
Because you need to set origin properties
setProperty('Pendelum.origin.x', 65)
, something like this I think, you can see the exact value in the source code
setProperty('Pendelum.origin.x', 65)
let me rq try that
Because you need to set origin properties
setProperty('Pendelum.origin.x', 65)
, something like this I think, you can see the exact value in the source code
this works i just had to change it to origin.y', 85 but how do i make it so it for 1, only starts moving when the song starts and for 2, loop back and forth infinitely
also the gamebanana page for what?
You're doing a mechanic from Lullaby, did you forget
also the gamebanana page for what?
You're doing a mechanic from Lullaby, did you forget
yes i did lol
Because you need to set origin properties
setProperty('Pendelum.origin.x', 65)
, something like this I think, you can see the exact value in the source codethis works i just had to change it to origin.y', 85 but how do i make it so it for 1, only starts moving when the song starts and for 2, loop back and forth infinitely
im still wondering how to do these 2 things tho
starts moving when the song starts
function onSongStart()
loop back and forth infinitely
Activate another tween after one finishes using function onTweenCompleted(tag)
, do a thorough read of the psych engine wiki and lullaby source first
It's a little too convoluted to explain through here so if you're interested I've already posted a Lua script of this mechanic in discussions
starts moving when the song starts
function onSongStart()
loop back and forth infinitely
Activate another tween after one finishes using
function onTweenCompleted(tag)
, do a thorough read of the psych engine wiki and lullaby source first It's a little too convoluted to explain through here so if you're interested I've already posted a Lua script of this mechanic in discussions
can you link it
function onSongStart() doTweenAngle('sleft', 'Pendelum', 45, 1, 'easeInOut') end
function onTweenCompleted(sleft) doTweenAngle('sright', 'Pendelum', -45, 1, 'easeInOut') end
function onTweenCompleted(sright) doTweenAngle('sleft', 'Pendelum', 45, 1, 'easeInOut') end
i added that under the code for the stage and it just swings left then stops
You only need one onTweenCompleted, the (tag)
is just to name the function variable, not where you put your tag
function onTweenCompleted(tag) --"tag" can be anything, but tag is just the common name
if tag == 'sleft' then
--new tween here
elseif tag == 'sright' then
--other tween here
end
end
Also worth noting that the way tweens work is: it will change the property to what value you give them, and stop there. In other words it will just rotate to 45 degrees and stop, every time
do you have discord it will be a lot easier to show you what im talking about instead of just typing it all out
cause when it tweens to swing to the right it doesnt work correctly
Because it's nowhere near how the original tween is done, so of course it will be weird I'm not sharing my discord
do onCreatePost not onCreate
Describe your problem here.
so im trying to make a infinite tween thing that makes something turn 45 degrees to the right then 90 degrees to the left so its swinging back and forth but the tweens arent working (im trying to add a pendulum thing i made without using adobe animate to animate the tweens cause i dont have it) whenever the song starts or anytime during the song, the pendulum thing just isnt turning like at all it just stays still and does nothing btw the image file of the pendulum is just a 1 frame image of a pendulum i made and before you ask, yes im trying to do all of this inside of the lua file of a stage
Are you modding a build from source or with Lua?
Lua
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
i added some other mods into psych engine (vs impostor, sonic exe, shaggy x matt, doki doki takeover, lullaby) and the images and stuff for them like the stages, characters and icons and stuff