There is no ImageTarget in Assets/Vuforia/Prefabs - unity3d

I followed the instructions to use Vuforia. But when I add ImageTarget, I found there is no ImageTarget in my Assets/Vuforia/Prefabs
The version of my unity is 2018.2.18f1.
I want to create an ImageTarget and Put the resources such as the model we need to display under ImageTarget as its child exists.
The picture here is what I got in Assets/Vuforia/Prefabs.

You don't need the prefab.
See Unity Manual: Adding Image Targets to your Scene
You can simply generate a new ImageTarget by clicking on GameObject → Vuforia → Image
This should add all required components like ImageTargetBehaviour, DefaultTrackableEventHandler, TurnOffBehaviour, MeshFilter and MeshRenderer.
You can also create it yourself from scratch by simply putting all the required components on an empty GameObject.
And then go on with configuring your database and target.

Related

Sprite Mask option doesn't appear

I want to create a Sprite Mask object. I follow the instructions on the unity docs:
To create a Sprite Mask select from the main menu GameObject > 2D Object > Sprite Mask
But the only option that appears is "Sprite". I am using the latest version of Unity (5.6.3p2)
Use an earlier version of Unity, 5.6 is quite old.
Here is the link https://unity3d.com/get-unity/download/archive
A Sprite Mask object is nothing but a gameobject with a SpriteMask script attached to it.
So create a empty game object and add a SpriteMask component to it through inspector manually

vuforia ARCamera videobackground is black

I have create assetbundle scene with vuforia ARCamera and an imagetarget. Now after loading the assetbundle scene, the scene is able to start with black screen. I have noticed that the ARCamera -> Camera -> BackgroundPlane->VideoMaterial(Instance) -> "Custom/VideoBackground" is not enabled. But when i enabled that manually, then the camera has enabled and showing live. Is there anyway to make that shader enabled after scene loads.
Picture-1:
Before enabling and scene was opened from assetbundle
Picture-2: After enabling shader option
Here is a more complete answer for future reference:
You can solve this issue by attaching to script to said GameObject that enables the shader upon awake, it would look something like this:
void Awake()
{
//get your video material component
VideoMaterial myVideoMaterial = getComponent<VideoMaterial>();
//Look for a shader called "VideoBackground" and apply it to the shader material of the component
myVideoMaterial.material.shader = Shader.find("Custom/VideoBackground");
Destroy(this);//this will remove this script after executing it, just looks a bit cleaner in my opinion but no necessary
}
More information about material shaders can be found in the unity docs here.
More information about Shader.find can be found in the docs here
This is assuming that you have a reference to the shader from a material already somewhere in your scene. If you do not you can as per Gowthy's comment add the shader to the "always included shaders" list. This can be found by going to the Graphics menu under Project Settings, and then scroll down to the "Always Included Shaders" section. Or you can add the shader to a "Resources" folder that gets included in the player build"
Delete the Vuforia folder from the assets directory.
Open player settings and uncheck Vuforia support from XR settings.
Choose the remove files options.
Then check the Vuforia support again.
Choose Vuforia camera in your scene.
Add the license key.
That's it.

How to replace model without a prefab file?

I'm new to ARCore and followed this article: https://haptic.al/arcore-101-fa6f93d4c003 to add a model with animation and see it with my phone camera.
I switched the model from the article (kitty) with a ball that I downloaded from Unity assets store, I just replaced the previous prefab object with the new one from the ball package that I imported.
Everything works fine, but now I want to download other model from the Unity store and I see that some models don't include the prefabs folder or a prefab file inside the the model package.
Is there another way to switch my current model with a new one without being use the prefab file?
Thank you.
Even if the downloaded file doesn't contain a prefab you can still create your own prefab by placing the object in the scene (.fbx, .obj files etc.) adding whatever materials you want it to have, and then dragging the name from the Hierarchy panel into the Project panel. The name in the hierarchy panel should turn blue if you've made a prefab successfully.
Note: you don't need a prefab to put something in the scene, a prefab represents an object that has a particular state saved instead of the defaults (transform rotation, materials, colliders, etc.). If you add things to an object and save that object as a prefab then whenever you place that prefab into the scene it will have those components still attached.

Unity 3D Cannot drag prefabs from project folder to scene

On Unity 5.3.4f1 when I try to drag any prefab (for example the standard asset FPSController prefab) from my Project folder onto the scene or Hierchay I get no response.
The prefab isn't placed and my cursor stays in pointer mode throughout.
This happens to me on all sample and new projects with and without an empty scene.
My Unity is on a MacBook Pro running El Capitan 10.11.3
This happened with me sometimes, one way to solve this is to create a empty prefab manually. In case you don't know how to do it
GameObjects -> Create Prefab
Tell me if it helps.

Inspector is disabled in unity

I added a blender file to my assets, and when I click on this file in assets I can't add a component such as SkinnedMeshRenderer to the imported asset as shown in this screenshot. How I can add it?
A SkinnedMeshRenderer is not something you can just add in Unity.
As said in the documentation:
Unity uses the Skinned Mesh Renderer component to render Bone animations, where the shape of the mesh is deformed by predefined animation sequences.
A SkinnedMeshRenderer is automatically added when a skeleton is found in your asset. To have a SkinnedMeshRenderer you must export a skeleton from blender. If you don't have a skeleton, it means that a SkinnedMeshRenderer is not required.
The "Imported Object" is a Unity asset that doesn't accept additional components. Try creating a prefab (right click in Project folder and select Create -> Prefab), give it a unique name, and then drag the "Imported Object" mentioned above, from the Project panel not from the inspector, onto the newly created prefab object in the Project panel. Components can now be added to the prefab. Whenever referencing blender models access them through prefabs in such a way. Prefab copies can be added to the scene by clicking and dragging the prefab into the scene or by using GameObject.Instantiate with scripts.