I am new to using Hardon Collider, so I'd like to some things cleared up due to the incomplete tutorial:
When you are defining collisions, would you have to in theory do this for all combinations of collisions (or at least every type of collision)?
Are all the parameters in setCollision necessary?
When dealing with a "speed" variable (such as a player.speed), could this be substituted for dx and dy (accounting for the fact that left and up are negative)? (I'm pretty sure you can)
These I feel were not clearly outlined in the (incomplete) tutorial. If anyone has any tips that I didn't ask about, feel free to add!
Questions on HardonCollider
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Questions on HardonCollider
You can simplfy your collision response by defining the responses on the shapes themselves.Garan wrote:I am new to using Hardon Collider, so I'd like to some things cleared up due to the incomplete tutorial:
When you are defining collisions, would you have to in theory do this for all combinations of collisions (or at least every type of collision)?
Code: Select all
local function onCollide(dt, shape1, shape2, dx, dy)
if shape1.onCollide then shape1:onCollide(dt, shape2, dx, dy) end
if shape2.onCollide then shape2:onCollide(dt, shape1, dx, dy) end
end
local HC = Collider(onCollide)
I can't find this function in the reference. Do you mean setCallbacks()? There are only two parameters. The first one is a callback function that is triggered when the collision starts and the second parameter is another callback but for when the collision ends. Looking at the documentation it looks like you can omit either of them.Are all the parameters in setCollision necessary?
I'm going to assume you're talking about the last two parameters of the collision callbacks. Those make up the separation vector, which is how much you should move the shape to escape the collision.When dealing with a "speed" variable (such as a player.speed), could this be substituted for dx and dy (accounting for the fact that left and up are negative)? (I'm pretty sure you can)
Who is online
Users browsing this forum: No registered users and 20 guests