• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Jiraya
      For a 2D game, does using a float2 for position increases performance in any way?
      I know that in the end the vertex shader will have to return a float4 anyway, but does using a float2 decreases the amount of data that will have to be sent from the CPU to the GPU?
    • By ThunderTwonk
      Hello everyone, I am working on a game idea and since I am still in the process of learning C# and the features available in unity I was hoping some of you might be able to offer me a little insight on things in general for getting started.
      I guess the basic components of what I'm wanting to create would be a Multi-levels management/city builder/rpg.
      The goal is to provide a framework for players to interact with, build in and affect the world both from a 3rd person action RPG as well as a zoomed out 4x style view (This would be something unlocked through gameplay)
      As for my questions go I was wondering if anyone had resources that could help me learn.  I've been on youtube as well as enrolled in an online course for basic unity and C# and will continue those but if anyone has any words of advice, a place that has good information and tutorials etc.
      Thanks for your time.
    • By Cahit Karahan

      Hi, I'm new in this forum. It is honorable to see such communities exist. I would like to share my new game. I did for android with unity. I know the game is a little awkward , but you have to know that this game is from the time when Unity's name is Unity3D  I have made my first game when I was 12. Now I am 22.  I have taken a lot of experience in this process and I can make better games nowadays. I have published this game nowadays but actually this game is very old but also it is very special for me :))
      I have just wanted to retouch and share this game, because it has a very important place for me.

      It's a special free 3D horror adventure action game for the halloween. Fun with scary sound effects and musics, 3D realistic graphics, you will feel the horror in the deep of your heart. Use your reflex. Totally free adventure. Totally scary horror game. 

      Tamarra, she is a beast from our world. She needs to consume souls from innocent people to stay alive. Story begins, the old Elaris tribe had lost their everything because of this beast who lived in the well. Araknas was the most powerful warrior of the tribe. One day, Araknas's mother was killed by the servant beasts of Tamarra. That's how Araknas's journey to the well begins. Tamara's well is guarded by horrible beasts. Araknas has to pass all servant beasts until he reaches Tamarra.

      Even death at the end is worth the revenge. 
      Are you brave enough to jump into Tamarra's well?

      Survive from witch attacks, clown attacks and many scary creature.

      - Realistic 3D graphics.
      - Scary sounds.
      - Scary musics.
      - Best experience with headphones.
      - A demon cage where you can imprison all the demons one by one
      - The witches do not like help, but they love blood stone. Witch store where you can develop your abilities and get new abilities.
      - Countless beasts.
      - At the end of the well there is a hidden surprise for you.

      *We do not recommend this game to people with clown phobia, spider phobia, or panic attacks.*

      **!!!**Note : This game is an early-access game, we are upgrading new features every day, new beasts, new improvements, as an example online 1vs1 fall on the list, so stay on connect and follow Halloween : Horror Well on Google Play.**!!!**

    • By INFRA
      SCAN. DRILL. SURVIVE.   ISOLATED Release in May 1st 2018   https://store.steampowered.com/app/805950/Isolated/   A game by Jérémie Bertrand Music & Sound Design by Pierrick Querolle *** Our solar system has been invaded by strangers. For the purpose of a possible negotiation, a team of astronauts is sent to the moon. Alas, they are shot before even arriving on the scene. Only one astronaut survives the crash and his only goal will be to go home...   GAMEPLAY   Shoot enemy ships to avoid being invaded. Be precise in your movements, because it's better to lose a bit of life at the top than to lose it all at the bottom. Take out your drill to destroy the stones in your path. Validate your identity to cross the different laboratories. Reach the flag before losing your three lives.   And all that... at the same time! Will you be able to go home? If the answer is yes, how long will it take?
  • Advertisement
  • Advertisement

Recommended Posts

So i began on my first and frankly it is really simple i just want a box to jump up and onto the next platform above it. They problem is when i look up a tutorial they don't get me where i want it. I need to know how to make a moving platform from side to side and then when my play lands on it the platform will center in the middle of the screen and stop so i can keep jumping up to the next platform. I can already make my player jump i also know how to make one way floors so that is covered i just cant figure out the platform.


Share this post

Link to post
Share on other sites

Well think of what you're doing in simple steps.

First : Move platform from side to side

Second : Detect Player Collision

Third : Center platform and player.


Now that we have what you need to get done laid out in clear view we can start on figuring out the best way forward.

For moving the platform side to side we merely need to change the position of the platform. Now you could move it a certain distance per frame but that will cause it to depend on the player's frame rate. A better solution would be to move the the platform a certain distance over a certain amount of time. I think there is two ways of doing this. The first is lerping the platform, the second being measuring the amount of time the last frame took and add the distance that the platform should of moved onto that. For lerping there is plenty of code all over the place for it so just google it. The second you'll have to start measuring for fps, yet again google is your friend. Now you have the platform moving from the center to one side, you need to set a limit and once the limit has been hit, invert the amount being added to the platform so that it moves backwards. Again have a limit set on the other side and repeat the invert once it reaches the limit. The easiest way for a limit is a if statement.


Now we have the platform moving from side to side we need to check if the player collides with the platform. There's two things you need to think about for this. First does the player touch the platform and second is the player falling. If the player jumps and hits the platform underneath you don't want it to magically appear onto and in the middle. So the falling bit is easy if you have the jumping script already done. Just check to see if the movement on the y axis is minus or something along those lines. The collision is a bit harder. I believe unity has its own collision system for 2d and 3d programs so I would look at a collision tutorial for what you require. Once you can detect the collision, check if the player is falling.


To center the player and platform the easiest way would be to have a predetermined middle point and just move the platform there and disable the platform's moving. Whether this is by having a simple boolean or setting the platform's movement to 0 it is up to you ( though the first is more efficient). Move both the player and platform to this middle point (I would just adjust the x axis and leave the player and platform on the same y as they are when they collide). Once they have been moved it is important to remember to set the player's falling to 0 or turn it off and re-enable jumping (depends on how you have your jumping system set up).


Hopefully this is a good enough walk through for you. I don't really want to write the code as it would take a little bit of set up and it is better if you try it yourself because you'll learn more. If you need help google some of the things I talked about or just ask here and post the code you're having troubles with.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement