How to make a light be attached to an object? [UNSOLVED]

Hey guys, I was wondering on how to make a light be attached to an object, so basically what I know has to happen is I have to get an object, and get the Vector3 location of it, and set that to the light, but I don’t know how to do that, any help guys?

Thanks in advance and for helping me so much already guys!

~ Light

you create a light in the scene, then drag it on to your game object. this is SUPER basic stuff. I suggest you do some tutorials in the learn section at the top.

1 Like

That’s not what i meant, I meant to like have it stick to an object, like a headlight in a car game or such. I want it to track with the balls and paddle in a pong game I’m making (nice to start simple right?).

Re-read what JamesLeeNZ told you. He gave you exactly the answer you need.

Lol, I overthought this, well I ended up just setting a point light as a target and making it go to the vector location, but thanks :P.

@LightWell as JamesLeeNZ stated, by dragging the light on to the “ball” you refer to as the headlight, you parent it’s transform to the ball transform. When you rotate the ball transform, or move it, the light will follow it. I think you should do some reading on Transforms in Unity, a google search such as “Unity3D Transform” yields good results.

~
Another walk in the park.