playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - strawberries036

Pages: [1]
1
PlayMaker Help / Re: Custom 2Dcontroller physics issue
« on: September 21, 2019, 09:10:31 AM »
Thanks Thore. I have been able to move the P31 Character Controller with editing the custom Action. All the collisions are pixel and frame perfect, but I notices that the character was jittering a bit after few moves. So I'll try to see what's going on there.
If I can manage to a have smooth moves and perfects collision, my next tasks will be easier (ground checking, jumps, wall jumps etc...)
Your idea of a second check with a wait is interesting and could work well.
If I'm giving up on writing or updating this custom controller I will definitely do that.

2
PlayMaker Help / Re: Custom 2Dcontroller physics issue
« on: September 20, 2019, 09:27:36 AM »
I made a quick edit on the action to show exactly what options I would like to add.


I think I should remove Jump eight and run speed, these options will be drive by the vector3 Move.

Obviously I don't know anything about coding so I have no clue of how I will do that.

3
PlayMaker Help / Re: Custom 2Dcontroller physics issue
« on: September 20, 2019, 06:22:19 AM »
Up!

I think I found the perfect tool to makes 2dController :
This is the Prime 31 CharacterController2D
https://www.youtube.com/watch?v=KpnImAdiiaQ

It's exactly what I wanted to achieve, Obviously I can't use it because I'm not scripting and didn't know how to translate variable to makes theme usable in playmaker.

But then I found that:

https://hutonggames.com/playmakerforum/index.php?topic=11323.0

It's really good but there is two options missing that are really important for me:

- Being able to edit vector movement and not having pre-made get axis values ( The actual Action is using getAxisRaw in the script, and I would like to enter the values myslelf to use my own "GetAxis" Action stored in a vector2  XY, exactly what the "Simple Move Controller" action is doing).

- Being able to store 4 bools when there is a collision for each sides so I can trigger event depending on where the colision is (if my character is on the ground I could store it and trigger a bool test with the bool "CollisionBelow")

If someone knows how to add theses options in the action that would be fantastic.

4
PlayMaker Help / Re: Custom 2Dcontroller physics issue
« on: September 18, 2019, 04:50:05 AM »

I think this is exactly what I want to achieve. But can't figure out how to transpose it in playmaker. There lots of things like the Hit distance that is already made is in the Raycast action. But I am always lost when I need to make the collision between my character and the ground.

5
PlayMaker Help / Re: Custom 2Dcontroller physics issue
« on: September 17, 2019, 05:29:46 PM »
After watching many tutorials and exploring all the alternative way to do it, I still struggle to have a perfect collision system with Playmaker.

Looks like a lot of people don't use the physics from unity, and the only way to achieve what I want is using Raycasts. But each time I'm watching a new tutorial to do it, there is a part I still don't understand.

My character is really simple at the moment it's a box that can be moved using get axis and "Translate".


I'm using a raycast 2d from my character. When the ray hit the ground, the distance is stored in "Hit Distance".

Then in an other fsm, I used a "Float compare" action.



When "Hit distance" is equal to zero, it send an event to set the get axis to 0.
It supposed to be simple but the collision is still aproximative. and with big speed it stop in the middle of the collider.



I want to precise that there is no gravity involve or anything right now.
I'm quite sure there is something wrong with my logic and raycast should maybe not be used like that.

6
PlayMaker Help / Re: Custom 2Dcontroller physics issue
« on: September 14, 2019, 02:46:57 AM »
So to be sure there was not any piece of code making this issue, I started with a fresh new scene.

There is nothing except a the player and the ground, 2 FSM for registering the A input, and the Jump system.



The listener is just a bool test on the press A button.
When A is pressed, the velocity is set to 0 to be sure we start from scratch then set velocity at 5 for 0.25 sec in realtime (I use this because later I need to make a jump that is jumping a bit higher if you hold the button, and it's not something I could do with an addforce2d)

So this is just basic and should work perfectly but:


The Jump should stop just on the top of the edge of this line but goes a bit higher sometime ( usually when  I have many windos open in the editor and checking the fsm to debug)



And a bit shorter sometime (when everything run smoothly and no window is open in the editor)

So I guess the rigidbody or the gravity is not calculated with fixed update.
This is a big issues when you need to do really precise jumps.

7
PlayMaker Help / Re: Custom 2Dcontroller physics issue
« on: September 13, 2019, 11:46:26 AM »
Looks like it didn't fix anything in the end.
It's tried many different structures to make the FSM clearest as possible but in the end it look like the physic engine is too slow.
I don't unterstand why but the raycast is detecting collision too late.

And I tried to make a jump that is not affected by the frame rate ( yes the rigidbody is jumping more or less higher depending of the frame rate).
I used velocity2d instead of addforce2d and tried to set the velocity to zero when the jump was done.

I think these two problems are link, maybe it's something to do with fixed updates.
Maybe I should simulate the gravity by adding a constant velocity to the controller. but I still don't understand how to calculate collision with the Raytrace.

8
PlayMaker Help / Re: Custom 2Dcontroller physics issue
« on: September 13, 2019, 04:50:51 AM »
Thanks for your help.I didn't really understood what you mean Jean. My issue was the overlapping contact with the "ground checker" and the side walls. The "ground checker" was detecting ground on a side wall because of the tiny overlap collision between the rigidbody2D and the TileMap wall.But what you wrote about probes made me think about a new fix, and this one seems to work well for the moment.
It's simple and didn't think about it before!



I just made an other raycast2D on each side just for detecting side walls.



Then when this ray hit, it changes the length of one of the "ground checker Raycast", so this one will not detect ground any more.
I don't have any slopes in my game so this is working fine.
I let you know if I encounter any unexpected issues!

9
PlayMaker Help / Re: Custom 2Dcontroller physics issue
« on: September 12, 2019, 12:32:56 PM »
Hi Thore,
Thanks for your help!
I don't really want to purchase an asset because I would like to have a total control of the movements and I have already made some wall jumps and climbing mechanics with Playmaker.

I tried using your method and it was working pretty well until I saw that sometime the Raytrace2D can still hit a side wall. It happens on rare occasion but I think it depend of my initial velocity and make imprecise collision on 1 frame.I'll try to make the ray length shorter and shorter to avoid this issue but it could make the fix for the edge of the platform not working again.


10
PlayMaker Help / Custom 2Dcontroller physics issue
« on: September 12, 2019, 05:10:13 AM »
Hello I'm using Playmaker on my first game and it's awesome, I had a lot of help by reading this forum already!

My game is a platformer 2D and I would like to have the same feeling as Celeste or Meatboy. I started to handle the control of the player by using a Rigidbody2D but I noticed that the jump is inconsistent and the ground check not really good.

Here is one of my issues:



The collider in red is to small and when i hit the border of a platform I can't jump anymore because the ground is not checked.



If i make the ground check collider bigger it might touch the wall when stick to a wall and can jump infinitely.



I tried using raycast2d but I had the same issue. the Ray origin was in the wall due to Physics that allow a small overlapping between the Rigidbody and the collider.

I saw some nice tutorial to create a controller without using Unity physics but they usually don't really explain well the logic behind the code:

https://www.gamasutra.com/blogs/YoannPignole/20131010/202080/The_hobbyist_coder_1_2D_platformer_controller.php

https://www.youtube.com/watch?v=OBtaLCmJexk&list=PLFt_AvWsXl0f0hqURlhyIoAabKPgRsqjz&index=2

My biggest issue is that I don't know how to use Raycast to set up the velocity of my controller. I have all the info with the Playmaker action but I'm lost when i need to use them.

Is it possible to combine as well Rigidbody with this Raycast solution?
OR to say that the raycast only detect a specific normal, so it will hit only the top edge of a boxcollider?

Pages: [1]