Actor disappears if this behavior is turned on

tintrantintran Member Posts: 453
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 Member Posts: 453

    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 Member Posts: 453

    just filed a bug in bugzilla.

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956
    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 Member Posts: 453

    @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.

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956

    @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 Member Posts: 453

    @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"

  • RabidParrotRabidParrot Formally RabidParrot. Member Posts: 956
    edited July 2015

    Nevermind it's windows.

  • tintrantintran Member Posts: 453

    @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 Member Posts: 453
    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 Member Posts: 30

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

  • tintrantintran Member Posts: 453

    @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 Member, PRO Posts: 5,354

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

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

    @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...Member, PRO Posts: 33

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

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @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.