#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Actor disappears if this behavior is turned on

Posts: 453Member
edited July 2015

I created an empty project,
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?

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.

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

• Posts: 453Member

just filed a bug in bugzilla.

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

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

• Formally RabidParrot. Posts: 956Member

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

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

• Formally RabidParrot. Posts: 956Member
edited July 2015

Nevermind it's windows.

• Posts: 453Member

@RabidParrot said:

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.

• 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 ?

• Posts: 30Member

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

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

• Posts: 4,585Member, PRO

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

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

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

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

• Posts: 9,901Member

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