About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
pick and drop 3d object on mobile
Author Message
amit Offline
Member

Post: #1
pick and drop 3d object on mobile
Hi,
I am tryin to pick and drop a 3d obj on a plane in 3d on mobile platform. I have a mesh imported from fbx with no physics.
Tried makin physics from editor, but it does not respond in code with Physics.ray(...)
also does phyx works in android/ios?
Also how to ray collision on plane?

Any code help would be nice,


Thanks
(This post was last modified: 12-26-2014 11:14 AM by amit.)
12-26-2014 11:13 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #2
RE: pick and drop 3d object on mobile
Hi there,

Make sure your touch is working correctly, using MouseTouch (MT, or something). You can definitely use Physics.Ray, I'm using it. I'll see if I can dig up some example code.
12-26-2014 06:09 PM
Find all posts by this user Quote this message in a reply
amit Offline
Member

Post: #3
RE: pick and drop 3d object on mobile
thanks, i did try code from "physics sample" but in vain.
Ill be waitin for ur code
12-26-2014 07:12 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #4
RE: pick and drop 3d object on mobile
Code:
Vec2 pos = MT.pos(0);      
Vec dir = ScreenToDir(pos);
Vec worldStartPos = ScreenToPos(pos, 0.001f);
            
if(Physics.ray(worldStartPos, dir*10, &hit))
{
    // Stuff
}
12-26-2014 11:08 PM
Find all posts by this user Quote this message in a reply
amit Offline
Member

Post: #5
RE: pick and drop 3d object on mobile
i tried this,
the problem is that my model does not have physics. how do i make it and set it.
12-29-2014 06:54 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #6
RE: pick and drop 3d object on mobile
Hi Amit, please see my response to this previous thread, it explains how to add physics to an imported object
12-29-2014 08:47 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #7
RE: pick and drop 3d object on mobile
Since you want to move the object, it would be best to use Convex physics, imo.
12-29-2014 12:52 PM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #8
RE: pick and drop 3d object on mobile
If you can use simple shapes (sphere, capsule, etc) for physics, that would work better. Also, enable CCD on the physics for these objects as they are often too small.
12-29-2014 03:04 PM
Visit this user's website Find all posts by this user Quote this message in a reply
amit Offline
Member

Post: #9
RE: pick and drop 3d object on mobile
ok found the problem, it was from my side, my model was a mesh type ... while it has to be a object!

sorry for troublin u all
12-30-2014 05:34 AM
Find all posts by this user Quote this message in a reply
Post Reply