Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
1
Question by serenefox · Feb 04, 2013 at 09:36 PM · terraintarget

Help with a target reticle moving across terrain

I am making a game for my scripting class and cannot figure out how to do this or even go about it. I am making a top down plane shooter and I was hoping to get a target reticle to be a child of the plane(player) so the player could drop bombs and the they could see visually where they would drop. My problem is I want the target reticle to move across the terrain instead of going through it because I do have uneven terrain. The bomb will fall in a trajectory of which I haven't decided yet but it will fly out and down instead of just straight down. I am only familiar with Js by the way. Thanks for looking.

Comment
Add comment · Show 3
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 iwaldrop · Feb 04, 2013 at 11:08 PM 0
Share

There are a couple solutions and each have different uses; it's hard to say which is the best from your description.

  1. Raycast and place the reticle on the terrain surface.

  2. Draw the reticle as an overlay; in this case it will not move about but still draw on top of everything else.

  3. Ensure that the cursor is at a height that will be above the terrain at all times; this will probably only work for orthographic projection.

If you're bomb fires forward and down at a constant velocity, and your terrain is uneven, then number one is probably your best bet. You can use a projector to draw the cursor directly onto the terrain and it will conform to it's shape without having to constantly rotate it to match the terrain's normals. It will also have the benefit of moving closer to the fighter when the terrain is higher, thereby giving the player a better approximation of where the bomb will actually land.

avatar image serenefox · Feb 04, 2013 at 11:30 PM 0
Share

Thanks the the reply iwaldrop, but think i am going to go with jbarba_ballytech's suggestion. It seems to work in the simplest way that still works. But again thank you for reply.

avatar image iwaldrop · Feb 05, 2013 at 01:35 AM 0
Share

Yeah, although I buried it in my comment, I think the projector route is the best.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by hoy_smallfry · Feb 04, 2013 at 11:25 PM

If you create an alpha mask of the reticle shape, you can change the shape of a spot light:

alt text

How to do this: Create a spot light, attach to your bomber. Then, set the "Cookie" property to the texture. To avoid texture tiling, set the texture Wrap Mode to Clamp instead of Repeat. Change the intensity and colors to your liking.

Now, the reticle will never clip out of the screen because it's part of lighting!


untitled.png (90.2 kB)
Comment
Add comment · Show 1 · 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 serenefox · Feb 04, 2013 at 11:32 PM 0
Share

jbarba_ballytech, Thanks for the answer I believe this will work. :D and thank you for the mock up.

avatar image
0

Answer by Eric5h5 · Feb 04, 2013 at 11:39 PM

Use a projector, such as the one in the example here.

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

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.

Follow this Question

Answers Answers and Comments

12 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

Related Questions

Make a simple tree 1 Answer

object following a target : pb if rigidbody activated 0 Answers

Rotating an object toward target AND with terrain? 1 Answer

procedural path painting on terrain 1 Answer

Terrain brushes cannot be set - BUG 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges