Hearthstone like slashing effect

slash.zip (342.7 KB)

Idea via https://twitter.com/ampgamedev

I’m not sure why the slash3 is right in editor but not in engine? Seems like I should not need to flip z like I did with slash2.

6 Likes

@jhonny.goransson could you check this example for the discrepancy between editor and engine when you can?

Yeah sure, meant to look at it yesterday but forgot!

2 Likes

Found an inconsistency (or at least something interesting):

  • Setting the scale programmatically in a script with go.set_scale(vmath.vector3(1,-1,1), “/slash3”) gives me an error: “Vector passed to go.set_scale contains components that are below or equal to zero”
  • Setting the scale programmatically on the sprite component with go.set("/slash3#sprite", “scale.y”, -1) works as expected…

So yeah, something is up :slight_smile:

Scaling below <=0 can be done for graphics, but is disastrous for physics. So that’s why it’s usually disallowed on a “generic” level.

Ah yes, that’s true… Well, in that case perhaps the editor behaviour should be synced with the engine and disallow negative scale for gos, or alternatively allow negative scale but at least produce a warning so you would have some kind of feedback.

Negative scales are useful in the application such as flipping a sprite left/right/top/down so please find a way to make that still work!