Tag Info

New answers tagged

2

You're on the right track. Not only do you have to divide the window's width and height in half, but you also have to divide the image's dimensions in half. Pseudocode would resemble something like this: // Center image in middle of screen. image.setCoordinates((screenWidth / 2) - (image.Width / 2)), ((screenHeight / 2) - (image.Height / 2))


0

As it currently stands, his positive z direction is equivalent to your negative z direction. Notice in the top right corner of the scene view, you have an axis indicator to tell you where the camera is currently facing (it says Persp, and shows x, y and z). Also notice how in the tutorial, his axis is aligned in the opposite z direction than yours. If you ...


0

The code is good and Unity it's working correctly (look at the arrows on the screenshot, they're pointing in the right direction). As far as the screenshot helps me to debug, you just need to rotate the object and go torwards th


1

By default, colliders in Unity will be centered on the object's pivot point (given by transform.position). It's possible to configure a collider such that it's not centered -- in this case, that offset is given by the sphere's center property, which is why you're seeing an offset of zero. In mooooost cases, transform.position will be fine. If your sphere is ...


1

In your second if you access the pillar and you set it to an object. When you try to access the pillar-Object, it never has been set and as such is initialized with null. This is your error. //first if { tempPillar = GameObject.FindGameobjectWithTag ("Pillars"); //second if with tempPillar! { pillar =tempPillar; //play ...



Top 50 recent answers are included