playMaker

Author Topic: Mouse pick and move forward cause object to shake around.  (Read 4103 times)

ryf9059

  • Full Member
  • ***
  • Posts: 100
Mouse pick and move forward cause object to shake around.
« on: March 17, 2014, 10:21:16 AM »
So I was trying to drag object around the screen in 3D space using mouse pick and move towards. I have consulted the following posts:

http://hutonggames.com/playmakerforum/index.php?topic=3349.0
http://hutonggames.com/playmakerforum/index.php?topic=102.0


It worked, kind of, but I find a problem: when I drag the object, if I keep the mouse stationary (I don't move, I just mouse down, but that too is regarded as a mouse drag event in playmaker) then the object is jumping around along the ray cast line. You can see it in the game play window, but if you see it in the editor window the effect is more obvious, the object is moving back and forth quickly along the ray cast line where the camera is facing at. If I'm dragging while moving mouse quickly the this effect will not happen. Why is that?

Also, in the move towards action there is a ignore vertical option, not sure how much it will do but I tried. It will not shake around this time be behaves somewhat abnormally, for example, quickly move to some other places if there is another object in front of the mouse when I drag, but this doesn't apply to every objects that I encountered, seems totally random to me. What is behind this?

Is there a way to drag around things  without object jumping around the ray cast line if mouse not moving?


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Mouse pick and move forward cause object to shake around.
« Reply #1 on: March 17, 2014, 12:25:30 PM »
Is your cast for the position change hitting the object you're trying to move? Make sure it's masked out as this would cause weird results.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Mouse pick and move forward cause object to shake around.
« Reply #2 on: March 17, 2014, 01:05:17 PM »
Is your cast for the position change hitting the object you're trying to move? Make sure it's masked out as this would cause weird results.

Yes, actually I have fsm on and only on that very object for the position change. When dragged, it will do a mouse pick and store as a vector, and then move towards that vector.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Mouse pick and move forward cause object to shake around.
« Reply #3 on: March 17, 2014, 01:08:53 PM »
Right, but if the object you're moving is involved in the pick then it can bounce around because its picking on something that is moving.

If thats not the issue, probably need to see some screenshots of the setup.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Mouse pick and move forward cause object to shake around.
« Reply #4 on: March 17, 2014, 01:41:44 PM »
Right, but if the object you're moving is involved in the pick then it can bounce around because its picking on something that is moving.

If thats not the issue, probably need to see some screenshots of the setup.

Yeah I guess that makes sense, seems to be the issue. But I'm still confused, if I don't move the mouse, there should be no movement as the picking vector did not change... or did it?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Mouse pick and move forward cause object to shake around.
« Reply #5 on: March 17, 2014, 01:47:51 PM »
It could, sure.

Other things could affect it as well, like if you have a Rigidbody on it and the physics engine was trying to move the object because of a collision, but the explicit transform was forcing it to that particular position. Kinda hard to tell without seeing the setup.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Mouse pick and move forward cause object to shake around.
« Reply #6 on: March 17, 2014, 02:10:10 PM »
It could, sure.

Other things could affect it as well, like if you have a Rigidbody on it and the physics engine was trying to move the object because of a collision, but the explicit transform was forcing it to that particular position. Kinda hard to tell without seeing the setup.

That sounds complicated.

So... how can I overcome this issue? Is there a way for me to drag the object without bouncing around even stationary?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Mouse pick and move forward cause object to shake around.
« Reply #7 on: March 17, 2014, 02:18:39 PM »
Some screenshots would help clarify whats at stake and how to fix it.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Mouse pick and move forward cause object to shake around.
« Reply #8 on: March 17, 2014, 02:33:04 PM »
Some screenshots would help clarify whats at stake and how to fix it.

I have recorded a short video, shows the basic setup and how it behaves while running.

http://screencast.com/t/m4wAbBDR

Playback is kinda choppy but that's caused by the recording software itself.
« Last Edit: March 17, 2014, 02:35:06 PM by ryf9059 »

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Mouse pick and move forward cause object to shake around.
« Reply #9 on: March 17, 2014, 11:22:04 PM »
Some screenshots would help clarify whats at stake and how to fix it.

I was thinking maybe disable rigidbody and set all speed to 0 while it's been dragged will help? Did you get any clue from the video above? Thanks.