As in, have the projectile at the exact same screen coordinates no matter where the camera is? Don't believe you can do that with a normal projectile (which you really shouldn't be using anyway), but you can use a helper.You'd need to constantly check/set the Pos of the Helper and set it according to GameWidth and GameHeight. I think you'd also need to use ScreenPos to do the necessary math.The X portion should be easy since the value is always relative to the center of the screen; it's the Y pos that's going to be a bit trickier since it's always relative to the stage floor and we have no StageHeight trigger.However, if we get the ScreenPos at Time = 0 (say, in a helper) while the Y Pos is 0, we can calculate the height in pixels from the bottom of the screen, effectively giving us the StageHeight we need:Code: [State x, VarSet]type = VarSettrigger1 = Time = 0var(x) = GameHeight - ScreenPos YUsing var(x) (where x is whatever variable number you want it to be), you should be able to do a PosSet for Y anywhere on the screen using a combination of Pos Y and ScreenPos Y.
Jesuszilla said, February 03, 2018, 01:43:28 pmAs in, have the projectile at the exact same screen coordinates no matter where the camera is? Don't believe you can do that with a normal projectile (which you really shouldn't be using anyway), but you can use a helper.You'd need to constantly check/set the Pos of the Helper and set it according to GameWidth and GameHeight. I think you'd also need to use ScreenPos to do the necessary math.The X portion should be easy since the value is always relative to the center of the screen; it's the Y pos that's going to be a bit trickier since it's always relative to the stage floor and we have no StageHeight trigger.However, if we get the ScreenPos at Time = 0 (say, in a helper) while the Y Pos is 0, we can calculate the height in pixels from the bottom of the screen, effectively giving us the StageHeight we need:Code: [State x, VarSet]type = VarSettrigger1 = Time = 0var(x) = GameHeight - ScreenPos YUsing var(x) (where x is whatever variable number you want it to be), you should be able to do a PosSet for Y anywhere on the screen using a combination of Pos Y and ScreenPos Y.But if I use the var as the y value in the PosSet sctrl, an error message appears : "Waring: expression truncated to integer" and the projectiles are still affected by the camera movement.Code: [State 305, VarSet]type = VarSettrigger1 = Time = 0trigger1 = ishelpervar(2) = GameHeight - ScreenPos Y[state 305]type=PosSettrigger1=1y=var(2)Am I doing something wrong?
Not at all. Well kinda. You just have a float value where it should be a whole number. Use y=Floor(var(2))