GameSalad

Actor disappears if this behavior is turned on

tintrantintran Posts: 453Member
edited July 2015 in Working with GS (PC)

I created an empty project,
added an actor,
dragged the actor onto scene,
added a accelerate towards behavior toward mouse position.
and if i preview it actor is gone
if i turned off the behavior actor is there when i preview.
What is up with that?
http://www.mediafire.com/download/lnbk0vf0p80emky/Actor_disappears_if_behavior_is_turned_on.zip

I had another similar problem too when I turned this off. and try to constrain actors rotation to a real variable. My actor also disappeared.

Answers

  • tintrantintran Posts: 453Member

    so I investigated into this, by constraining game variables to find minimum and maximum of mouse.position
    It turns out that that when preview starts, mouse position x and y are defined as "inf"
    so I guess that's why accelerate would basically take the actor right outside of screen and get destroy.
    The work around to this is to use to accelerate toward max(a,min(b,mouse.position.x)) and max(c,min(d,mouse.position.y)).
    this way when mouse.position is at first "inf" it doesn't take actor outside of scene.

  • tintrantintran Posts: 453Member

    just filed a bug in bugzilla.

  • TrappedStudioTrappedStudio Formally RabidParrot. Posts: 954Member
    edited July 2015

    You need to tell that actor that if mouse position.y > 0 then fire your accelerate rule.

    Without user input the default values of mouse position x/y are = 0. Therefore your actor is accelerating towards 0. Your actor will eventually be off the scene.

  • tintrantintran Posts: 453Member

    @RabidParrot said:
    You need to tell that actor that if mouse position.y > 0 then fire your accelerate rule.

    Without user input the default values of mouse position x/y are = 0. Therefore your actor is accelerating towards 0. Your actor will eventually be off the scene.

    Not eventually but instantly of the screen because game.Mouse.position.x and y are set to "inf" when preview starts out.

  • TrappedStudioTrappedStudio Formally RabidParrot. Posts: 954Member

    @tintran said:
    Not eventually but instantly of the screen because game.Mouse.position.x and y are set to "inf" when preview starts out.

    Well if you are constraining it's position it would be instantly.

  • tintrantintran Posts: 453Member

    @RabidParrot said:
    Well if you are constraining it's position it would be instantly.

    Nope i didn't constraint my actor's position to mouse.position (I used accelerate toward).
    I only constraint game variables to max() and min() of mouse.position to find out what was happening and found out that it's set to "inf"

  • TrappedStudioTrappedStudio Formally RabidParrot. Posts: 954Member
    edited July 2015

    Nevermind it's windows.

  • tintrantintran Posts: 453Member

    @RabidParrot said:
    Downloading your project now...

    I found a work around, but filed a bug because mouse position shouldn't be set to "inf" as it is not..it can be negative or a large positive number if it's outside the scene but shouldn't be "inf" as "inf" is i think what caused my actor to disappear when i should be able to see my actor slowly accelerate toward outside of screen.

  • tintrantintran Posts: 453Member
    edited July 2015

    @RabidParrot said:
    Nevermind it's windows.

    Yeah but you can use the same project. Do you mean this bug might not be happening on the Mac Creator ?

  • Ayolabi12345Ayolabi12345 Posts: 30Member

    if _______ is false destroy this actor.
    put this on the actor you want to disappear

  • tintrantintran Posts: 453Member

    @Ayolabi12345 said:
    if _______ is false destroy this actor.
    put this on the actor you want to disappear

    I don't want any actor to disappear, i think you might have misunderstood my discussion/question.

  • ArmellineArmelline Posts: 4,405Member, PRO
  • Chris__GamesChris__Games Somewhere, so far away...Posts: 33Member, PRO

    @tintran For me, I usually try to slow the actor down, it makes the object slow, but it works a lot better...

  • Chris__GamesChris__Games Somewhere, so far away...Posts: 33Member, PRO

    @tintran I downloaded it, it corrupted the game I was working on, well crap...

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,877Member

    @Armelline said:
    When I run this project, the actor does not disappear. Perhaps it's a Windows issue.

    Yeah I was gonna say this doesn't happen on Mac version.

Sign In or Register to comment.