Press - Drag Outside Actor - Release - Start (Problem)
Sandbird
Member Posts: 69
Hello people,
I've been having this problem for 1 week now. I am trying to do this :
Press down on an actor, drag mouse outside towards x,y with radius z from actor, then release mouse.
While dragging there is an arrow actor starting from my main actor changing width and size towards my mouse move.
When i release the mouse the arrow freezes on the last location of the mouse.
Then when i press another button the actor will move with velocity x and y towards that direction and the arrow will become hidden.
This proccess can repeat itself when the main actor stops moving.
I've seen the pool table example and was able to do about 90 % of this but i am having trouble figuring this out:
- How will the main actor know when you released the mouse after touching him ( simple mouse up wont do cause i am planning to have 2 more actors like this and i dont want all of them to listen to the mouse up )
- I am adding incremented drag to the actor after shooting but he never comes to a complete halt. I've tried changing his friction, velocity, drag to infinity but nothing. In the end he wobbles a bit. I want the little sh...t to stop COMPLETLY!
Thats it. Any help or input would be appreciated and sorry for the long post.
I've been having this problem for 1 week now. I am trying to do this :
Press down on an actor, drag mouse outside towards x,y with radius z from actor, then release mouse.
While dragging there is an arrow actor starting from my main actor changing width and size towards my mouse move.
When i release the mouse the arrow freezes on the last location of the mouse.
Then when i press another button the actor will move with velocity x and y towards that direction and the arrow will become hidden.
This proccess can repeat itself when the main actor stops moving.
I've seen the pool table example and was able to do about 90 % of this but i am having trouble figuring this out:
- How will the main actor know when you released the mouse after touching him ( simple mouse up wont do cause i am planning to have 2 more actors like this and i dont want all of them to listen to the mouse up )
- I am adding incremented drag to the actor after shooting but he never comes to a complete halt. I've tried changing his friction, velocity, drag to infinity but nothing. In the end he wobbles a bit. I want the little sh...t to stop COMPLETLY!
Thats it. Any help or input would be appreciated and sorry for the long post.
Comments
I dealt with the actor giggle issue in my project by determining when the actor was not moving then throwing a large velocity (like gravity) at it. I also have spawned a copy non-moveble actor in it place in another instance. Haven't fully reviewed how those effect performance yet but they worked.
I've thought about that attribute thing also and gave it a go...the thing is that you dont have a "When to set the attribute" factor. All the rules apply on actors and if i could say "when mouse up -> actorActive =0" then the actor i assign this rule wont understand mouse up cause my finger is already outside the actor. See my problem :P ?
It has to be something global, something like :
- I am pressing actor (ok, actor1isPressed = 1) [actor->global variable]
- I am leaving the actor1 area but havent release the mouse yet (ok, mouseReleasedfromActor1 = 0) [global variable]
- IF mouseReleasedfromActor1 = 1 then i have released the mouse from actor1 and do this.... [can be actor2 listening to global variable]
But where to put the second line ? I cant put it on the actor1 cause he doesnt register mouse up cause i am already outside his area.
And about the giggle issue, I've made a copy of the main actor but set its clone to a non movable object so i say when velocity = 0, destroy actor1 and spawn his clone, so its not moving. The problem is that i also have angular drag from collisions so when the clone spawns it spawns with the wrong rotation. Plus i dont want to affect so much the physic attributes since i want other actors to collide with actor1 and still have him move a bit if hit.
I dont understand why this giggle happens....it makes no sense. Drag should bring the actor to a stop state....I think a "Stop" variable is missing from the GameSalad...It shouldnt be that hard to make a player stop moving...ffs