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
0
Question by jasoncosma · Jun 22, 2012 at 08:29 PM · 2dgameobject

How to form copies of yourself that follow you when you walk? (2D Platformer)

Is this possible? In my 2D platformer; I want to make copies of myself whenever I walk? Is there something like this that duplicates the player every x seconds so it would look like the player has copies behind him when he walks that would follow him around?

Something like this: http://www.advancedanime.com/pictures/normal_sonic88run.jpg

Thanks guys, I appreciate any help

Comment
Add comment · Show 2
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 Fattie · Jun 23, 2012 at 09:55 AM 1
Share

for sure, just do what is explained.

NOTE - generally you just make iN ADVANCE say ten copies of the object, and then move them around. Don't literally instantiate them on the fly. O$$anonymous$$?

avatar image jasoncosma · Jun 23, 2012 at 09:48 PM 0
Share

Alright, that sounds good. These are good suggestions and I know what I'm doing now. Thanks guys

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by ColinBurke · Jun 22, 2012 at 09:20 PM

Absolutely, just copy the character object, and offset it's position, perhaps relative to the player's velocity? Alliteratively, you could store the player's past positions and use them to place the copies. You could then change the character's material's color value to simulate a fading effect.

So, yes it's entirely possible with some simple code.

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 gregzo · Jun 22, 2012 at 09:13 PM

If you have pro, you could use motion blur, which judging by your example pic is what you're after.

If you want more precise copies, specialy in a 2d game, why not simply clone your sprite with a time/space offset and a decreasing alpha? If your prefab has an alpha var and a delayToInput var, it shouldn't be impossible to fake.

Very rough pseudo code, just to give the gist of things:

 var delay : float; //set this to 0 on your main sprite
 var alpha : float; //set this to 1 on your main sprite
 var xOffset : float; //set this to 0 on your main sprite

 thisSprite.alpha = alpha;
 thisSprite.position.x += xOffset;

 function RunRight()
 {
     yield WaitForSeconds(delay);
     RunRightNow();
 }

If you have 4 or 5 instances of your main sprite, whith quite a bit of experimenting and tweaking, this kind of approach could work. You'd have to do some lerping around, and just see what works for you! Did a much simpler but somewhat similar thing recently, faking reflections.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Score system 1 Answer

How to handle a MASSIVE amount of game objects? 2 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

creating a 2d game object like doom 2 Answers

Scripts wont work if deactivated then activated? 0 Answers


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