• 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 /
avatar image
0
Question by borutkolar · Jul 31, 2017 at 02:06 PM · 360-degreesmovinggameobject

Placing object in scene

Hello!

In Unity, I have a scene which has a texture that is a 360-degree picture, therefore the whole scene is set on the globe. Somewhere on this scene there is an owl. I want to move an object (cube) directly on this owl, so the cube will be in front of the owl. When I try to move this cube manually I am not successful because the cube is always placed somewhere near the owl but never just in front of it. How could I solve my problem?

Greetings

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Ataraxxis · Jul 31, 2017 at 02:27 PM

Can you provide more information? What is the object that the picture is on (sphere, skybox) with which shader? Is the owl part of the 360-degree picture or an object itself?

Comment
Add comment · 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
0

Answer by borutkolar · Jul 31, 2017 at 02:37 PM

Picture is on sphere with Unlit/Texture shader. Owl is part of the 360-degree picture, it is not an object itself.

Comment
Add comment · Show 14 · 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 Ataraxxis · Jul 31, 2017 at 08:59 PM 0
Share

So to just have an object in between camera and owl you should be simply able to drag it there, though it was the main problem let's try to solve it mathematically.

  1. Scale the sphere really huge and place an empty gameobject into the owl. This is now the owls position (we can't use the sphere position here).

  2. calculate a vector that describes the line between camera and owl: (positionOfOwl - positionOfCamera) * x + positionOfCamera

  3. Create any object and set it's position to the position the upper equation gives for x = 0.5 (so it should be halfway between owl and camera).

If you still don't see your object maybe look at your camera and rearange near/far clipping plane (or use a bigger/smaller scaling in scene).

And if this still doesn't work, upload your code please and share a link.

avatar image borutkolar · Aug 01, 2017 at 09:39 AM 0
Share

This isn't working for me. Position of my camera is (0, 0, 0). When I am on some zooming I place the cube directly on the owl. But the problem is that then when I zoom in/out this cube it's no longer in the same position. I attached two screenshots - the first one shows how the cube is displayed in editor, the seconds one shows the cube when I am in play mode (cube is above the owl and is very small and red). alt text alt text

avatar image Ataraxxis borutkolar · Aug 01, 2017 at 01:56 PM 0
Share

I don't know in which level you are understanding Unity, so first thing the view in scene is not based on your camera, in your pictures you have a different view angle. Also look if your scripts change something with your objects, note position, rotation and scale for the sphere, cube and camera and look if they change when entering play mode.

avatar image borutkolar · Aug 01, 2017 at 02:24 PM 0
Share

I am beginner in Unity but I know that the views in the editor and in the play mode aren't the same. I don't think the scripts change objects when entering in play mode. What I want to do is that when I move the phone (or cursor on computer in play mode) to the owl, the program plays sound of the owl.

avatar image Ataraxxis borutkolar · Aug 01, 2017 at 03:18 PM 0
Share

I would recommend not putting the owl on the sphere, mostly spherical projections are used for the background (and only the background). What if you cut the owl, put it on a quad and use a script on this quad with On$$anonymous$$ouseOver(). This way you have the mouse collision and owl position in one object. To fix the problem with the cube being displaced I would need the project, can't say where exactly the mistake is.

avatar image borutkolar Ataraxxis · Aug 01, 2017 at 04:48 PM 0
Share

How can I cut the owl and put it on the cube? The owl is part of the picture. I can send you project source.

Show more comments

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

69 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

Related Questions

Dragging object with a mouse from one point to another point, Have a big problem 1 Answer

How to make an 2d object jump from A point to B point? 0 Answers

Object in center, and the camera/player can rotate to view it in 360 degree 1 Answer

Is it possible to create a VR video animation? 0 Answers

issue after 360 degrees rotation 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges