Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by Pascal0711 · Mar 29, 2016 at 11:44 AM · animationplayercolortrailpool

Trail of color behind the player 2D c#

I want to make a game where the player(the ball) goes into a pool of color as you can see in the picture. when the player walks he should painting the ground he is walking on. And my question is how should i realise this I tried trailrenderer and linerenderer, but it is quite messed up and I am not sure if this is a good option. I would appreciate any help.alt text

gamepic.png (30.1 kB)
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

1 Reply

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

Answer by Brocccoli · Mar 29, 2016 at 01:24 PM

I would make a component script called ColorTrailComponent and attach it to my player.

 [RequireComponent(Transform)]
 public class ColorTrailComponent : MonoBehavior
 {
   Transform playerTransform;
   void Start()
   {
     playerTranform =  = getComponent<Transform>();
   }
 
   void Update()
   {
     DrawSpot();
   }
 
   protected void DrawSpot()
   {
   //Use the players tranform position to draw on the gameScreen. Possibly another gameObject called
 //paintSpot or something, that is just a certain colored sprite and instantiate it and place it on
   //the game screen at the players location, under the player
   }
 }

Comment
Add comment · Show 4 · 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 Pascal0711 · Mar 29, 2016 at 03:19 PM 0
Share

Ok thanks for the great idea it works well, but i dont want to draw the paint on spots which are already painted. $$anonymous$$aybe I can do this with a collider?

avatar image Brocccoli Pascal0711 · Mar 29, 2016 at 07:57 PM 0
Share

Yea, possibly.

You could have the paint sprites have a collider that causes a boolean value to toggle on in the player allowing it to drop paint or not.

Then check the boolean value in player before dropping paint.

avatar image Brocccoli Pascal0711 · Mar 29, 2016 at 07:59 PM 0
Share

Don't forget to upvote and accept the answer if it helped you.

avatar image Pascal0711 · Mar 29, 2016 at 08:11 PM 0
Share

Ok Thanks for you help

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

iTween: How to animate other shader-color values besides the main Color? 1 Answer

How do I play the same animation in other places in the game world? 1 Answer

How To Make Enemy Chase You? 1 Answer

Character Controller Component, Gravity/inertia, and Root Motion 0 Answers

Text displays during animation 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