Actor disappears if this behavior is turned on
tintran
Member Posts: 453
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
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.
just filed a bug in bugzilla.
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.
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"
Nevermind it's windows.
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.
Yeah but you can use the same project. Do you mean this bug might not be happening on the Mac Creator ?
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.
When I run this project, the actor does not disappear. Perhaps it's a Windows issue.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@tintran For me, I usually try to slow the actor down, it makes the object slow, but it works a lot better...
@tintran I downloaded it, it corrupted the game I was working on, well crap...
Yeah I was gonna say this doesn't happen on Mac version.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS