Rigidbody prob

Hey guys im not sure why this error is happening. It might have something to do with me having untiy2017 or i just did something wrong but i dont think i have.


^^^^^ This error happens when i click the ball

First thing to check is your outputs. I suspect the issue lies in the DragEnd method of DragLaunch and the time element as NaN is Not a Number which suggests a division by 0.

Put a debug line for something like:

Debug.Log("launchVelocity="+launchVelocity+" , Duration was="+dragDuration);

Hello i have tried your Debug.Log(“launchVelocity=”+launchVelocity+" , Duration was="+dragDuration); code

and this is what printed

This error happens when i click the ball

Are you holding down the mouse button and the moving the mouse to create the actual drag?

When i click to hold down the error happens.

When you click, is your mouse within the Game window?

Yes, i click on the ball and then the error pops up before i can drag

Can you pop a screenshot up of the Inspector when you have the Touch Input GameObject selected in the Hierarchy please.

Sure,

Thanks.

You have set both methods for the same event, e.g. Pointer Down.

  • delete the method call, DragLaunch.DragEnd, for the event Pointer Down
  • click the Add New Event Type
  • select PointerUp
  • drag the Ball GameObject from the Hierarchy to the Object property
  • select the method, DragLaunch.DragEnd in the function dropdown menu
  • save the scene
  • run the game

image
(names may vary between our solutions)

Hope this helps :slight_smile:

Oh Yes, Thank you so much

1 Like

You’re welcome. :slight_smile:

A post was split to a new topic: Unity or Unreal, which is better for graphics?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms