- Home /
Imported Blender objects behave strange (too small?)
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.
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?
*note, i'm making a medical game so the objects i'm 'picking up' are rather small (10cm - 30cm) (syringes, thermometer etc.)
Your answer
![](https://koobas.hobune.stream/wayback/20220612114908im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
What is the advantage of using the humanoid animation type vs using a generic animation type? 2 Answers
Blender rotation import with skinned mesh renderer 0 Answers
Inconsistent Blender import 1 Answer
Object mesh collider acting strange 0 Answers
Blender to Unity Import: Some bones do not animate properly when played onto an existing prefab 2 Answers