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 pranayrangne · Jun 29, 2017 at 02:11 PM · unity 52d gametrailrenderer

How to make a game like Blek??

I want a game like Blek can anyone help me how to make a replica of that game I already searched over the internet but it couldn't help me i a beginner in this Game development thing and I want this kind of Game for my College project can anyone help me with that i just want to know how the mechanism works i mean i used Trail Renderer and using rigidbody2d.velocity , i am able to move the trail in horizontal line but i want to move it like blek game and i am unable to get the logic what kind of code should i used to get the game play like blek Please help me thank you.

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
0

Answer by rodude123 · Jun 29, 2017 at 02:36 PM

Show what code you created and what code you tried to make it move like blek. Have you tried to get the mouse position and its direction? Once you got the mouse position and its direction you need to draw the trail following the mouse position and direction. You could record the position into an array of vector2's then draw them programmatically using code afterwards. Hope this helps

Comment
Add comment · Show 2 · 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 pranayrangne · Jun 29, 2017 at 07:30 PM 0
Share
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class touch : $$anonymous$$onoBehaviour {
     private Rigidbody2D myRigidbody;
     private float movementSpeed = 3f;
     public Transform target;
     // Use this for initialization
     void Start () {
         myRigidbody = GetComponent<Rigidbody2D> ();
 
     }
     
     // Update is called once per frame
     void Update () {
 
 
         if (((Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.$$anonymous$$oved) || Input.Get$$anonymous$$ouseButton (0))) 
         {
 
 
             Plane objPlane = new Plane (Camera.main.transform.forward * -1, this.transform.position);
 
             Ray mRay = Camera.main.ScreenPointToRay (Input.mousePosition);
             float rayDistance;
             if (objPlane.Raycast (mRay, out rayDistance))
                 this.transform.position = mRay.GetPoint (rayDistance);
         
             Vector3 touchDeltaPosition = Input.mousePosition;
             //transform.Translate(touchDeltaPosition.x * movementSpeed, touchDeltaPosition.y * movementSpeed, 0);
             myRigidbody.velocity = new Vector2(movementSpeed,0);
             Debug.Log(touchDeltaPosition);
 
         }
 
 
     }
         
 }

this is my Code Help $$anonymous$$e Sir thank you

avatar image rodude123 · Jul 03, 2017 at 10:38 AM 0
Share

This is good you just need to generate particles using the particle system and make it follow the object so attach it to the object in someway

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

130 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image 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

Scale Sprites Smoothly - problem 0 Answers

Rotating a 2D sprite(Ring) in a fixed position 0 Answers

trail renderer shows above everything (Unity 2D sorting layer ) 0 Answers

Custom trail fixed length and custom form 1 Answer

How to use Trailrenderer.Getpositions? 3 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