HouseAdmin
HouseAdmin
CC#
Created by HouseAdmin on 8/3/2024 in #help
Syntax for c# to do this?
c#
public override void _PhysicsProcess(double delta)
{
if (DetectCollision(Player, Floor))
{
Player.position
}
}
c#
public override void _PhysicsProcess(double delta)
{
if (DetectCollision(Player, Floor))
{
Player.position
}
}
How do i access the Player.position here in c#?
14 replies
CC#
Created by HouseAdmin on 8/2/2024 in #help
✅ What syntax for c#?
What is the syntax for this code? in c#
c#
return (
a.minX <= b.maxX &&
a.maxX >= b.minX &&
a.minY <= b.maxY &&
a.maxY >= b.minY &&
a.minZ <= b.maxZ &&
a.maxZ >= b.minZ
);
c#
return (
a.minX <= b.maxX &&
a.maxX >= b.minX &&
a.minY <= b.maxY &&
a.maxY >= b.minY &&
a.minZ <= b.maxZ &&
a.maxZ >= b.minZ
);
39 replies
CC#
Created by HouseAdmin on 8/1/2024 in #help
syntax for c# to do this math.
function checkCollision(a, b)
--With locals it's common usage to use underscores instead of camelCasing
local a_left = a.x
local a_right = a.x + a.width
local a_top = a.y
local a_bottom = a.y + a.height

local b_left = b.x
local b_right = b.x + b.width
local b_top = b.y
local b_bottom = b.y + b.height

--Directly return this boolean value without using if-statement
return a_right > b_left
and a_left < b_right
and a_bottom > b_top
and a_top < b_bottom
end
function checkCollision(a, b)
--With locals it's common usage to use underscores instead of camelCasing
local a_left = a.x
local a_right = a.x + a.width
local a_top = a.y
local a_bottom = a.y + a.height

local b_left = b.x
local b_right = b.x + b.width
local b_top = b.y
local b_bottom = b.y + b.height

--Directly return this boolean value without using if-statement
return a_right > b_left
and a_left < b_right
and a_bottom > b_top
and a_top < b_bottom
end
34 replies