Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by sanderbos24 · Apr 11, 2017 at 04:14 AM · blendergooglepickupimported

Imported objects don't react to script (default cube does)

Hi y'all,

I encountered a strange problem with imported objects from Blender. I placed the .blend file in the 'assets' folder so unity recognizes them, I put a box collider and a rigidbody on them, but somehow I can't drop the objects after I've picked them up. This only happens with the Blender models, if i try it with a default cube it works perfectly. The rotation and scale values are all set to 0 (rotation) or 1 (scale)

Here's the pick up code: (I work with Google Daydream btw)

 using UnityEngine;
 using UnityEngine.EventSystems;
 using System.Collections;
 
 public class Pickupable : MonoBehaviour, IPointerClickHandler {
     private bool isPickedUp = false;
     private float distanceFromPointer;        
     public float movespeed = 0.02f;          
 
 
     public void OnPointerClick(PointerEventData pointerData) {                
         isPickedUp = !isPickedUp;
         distanceFromPointer = pointerData.pointerCurrentRaycast.distance;    
     }
 
     void Update() {
         if (!isPickedUp) {        
             return;
         }
 
         if (GvrPointerManager.Pointer == null) {    
             return;
         }
 
         Transform pointerTransform = GvrPointerManager.Pointer.PointerTransform;
         Vector3 followPosition = pointerTransform.position + (pointerTransform.forward * distanceFromPointer);
         transform.position = followPosition;
 
         if (GvrController.IsTouching) {                        
             Vector2 touchPos = GvrController.TouchPos;      
             //Debug.Log (GvrController.TouchPos.y);            
 
             if (GvrController.TouchPos.y <= 0.25f) {                            //if the users' thumb is on the upper side of the touchpad            
                 distanceFromPointer = distanceFromPointer + movespeed;        //move the object AWAY from the user
             } else if (GvrController.TouchPos.y > 0.75f) {                    //if the users' thub is on the lower side of the touchpad
                 distanceFromPointer = distanceFromPointer - movespeed;        //move the object TOWARDS the user
             }
         }
     }
 }

Using the trackpad I 'move' the object further or closer to be able to drop and pick up the objects where-ever I want. A strange thing to notice though is sometimes i click the touchpad to pick up an object and if i don't move my thumb and click again it drops perfectly, but if i move my thumb (for example to bring it closer) and press the touchpad again it won't drop.

Anybody have a clue what's going on?

alt text

alt text

*note, i'm making a medical game so the objects i'm 'picking up' are rather small (10cm - 30cm) (syringes, thermometer etc.)

EDIT; I uploaded the wrong image, the scale and rotation are truly 0 and 1 respectively

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by sanderbos24 · Apr 11, 2017 at 09:01 AM

I suspect it has something to to with the size and complexity of the models.

-Import default cube from Blender as FBX --> attach script --> works perfectly -Some small editing on the default cube in Blender (extrusions) --> export FBX --> attach script --> works perfectly -Make edited default .FBX cube smaller --> can only pick up and very occasionally drop it somehow....

I literally have no clue what's going on, the models i've made are all relatively simple and not too too small (>10cm)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dsternfeld · Apr 18, 2017 at 02:20 AM 0
Share

I suspect there is something going on related to the size of the Box Collider not matching the size of the object. The size of the Box Collider looks very small in the image you uploaded. What do the box collider bounds look like in the editor?

You may want to change the scale factor of the fbx in the fbx import settings for the model, and then leave the scale at 1,1,1 in the actual scene.

Alternatively, have you tried using a $$anonymous$$esh Collider?

avatar image sanderbos24 dsternfeld · Apr 21, 2017 at 03:24 AM 0
Share

it's fixed! i installed the new version of Unity (0f3) and that fixed it ;)

I also did what you suggested, but that didn't help, anyway, it's working as it should now! Thank you

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

110 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I have problems using the tree brush in terrain. I made some trees on blender and works well when you drag to scene but if I use the trees with the brush the leaves doesn't appear. 1 Answer

Pickup Objects with Google Daydream Controller 1 Answer

Unity Firebase Google SignIn Error Help 0 Answers

Picking up 2D collectables in an order? 0 Answers

Weird animation deformations, any ideas? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges