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
I'm trying to make a script that makes camera move upon hitting a note. up makes the camera go up, down makes the camera go down, left tilts the camera to the left, and right tilts the camera to the right. But everytime I try to use the script, the camera never moves when hitting the note.
btw, I'm using psych 1.0.
Here's my code:
var lerpVal:Float = FlxMath.bound(elapsed * 2.4 * cameraSpeed, 0, 1);
var offX:Float = 0;
var offY:Float = 0;
var offA:Float = 0;
var focus:Character = PlayState.boyfriend;
var curSection:Int = Math.floor(PlayState.curStep / 16);
var name = focus.animation.curAnim.name;
use game.curSection instead of var curSection.
change your all PlayState to game.
you must change gf to game.gf in the part where focus is designated as gf.
when checking character's animation, you don't updated the name after set focus to someone.
you didn't applied them after you defining offX, offY.
there's no code to check the section of the boyfriend.
remove lerpVal because it wasn't used.
Describe your problem here.
I'm trying to make a script that makes camera move upon hitting a note. up makes the camera go up, down makes the camera go down, left tilts the camera to the left, and right tilts the camera to the right. But everytime I try to use the script, the camera never moves when hitting the note.
btw, I'm using psych 1.0.
Here's my code:
var lerpVal:Float = FlxMath.bound(elapsed * 2.4 * cameraSpeed, 0, 1);
var offX:Float = 0;
var offY:Float = 0;
var offA:Float = 0;
var focus:Character = PlayState.boyfriend;
var curSection:Int = Math.floor(PlayState.curStep / 16);
var name = focus.animation.curAnim.name;
function onUpdate(elapsed)
{
if(!game.inCutscene && !game.paused && !game.freezeCamera)
{
if(PlayState.SONG.notes[curSection]!=null){
if (PlayState.gf != null && PlayState.SONG.notes[curSection].gfSection)
{
PlayState.focus = gf;
}else if (!PlayState.SONG.notes[curSection].mustHitSection)
{
focus = PlayState.dad;
}
}
if(focus.animation.curAnim!=null)
{
if(name.startsWith("singLEFT"))
{
offX = -20;
offA = 1.3;
}
else if(name.startsWith("singRIGHT"))
{
offA = -1.3;
offX = 20;
}
if(name.startsWith("singUP"))
offY = -20;
else if(name.startsWith("singDOWN"))
offY = 20;
}
}
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.
No
The text was updated successfully, but these errors were encountered: