Answer the question
In order to leave comments, you need to log in
How to make a variable change value depending on object coordinates?
You need to make the facingRight variable change to false if the coordinates of char1 by Scale = -1, 1
A, it gives me an error: Cannot implicitly convert the type "UnityEngine.Vector3" to "bool"
Here is the code:
if (char1.transform. localScale = new Vector2(-1 ,1))
{
Shon.facingRight = !Shon.facingRight;
}
Answer the question
In order to leave comments, you need to log in
Inside the if is an assignment, not a check. The first step is to change "=" to "=="
1. The description of the task is not very clear, can you give an example of the data in these tables and the desired result?
2. “the set of categories is wider” - is this where the number of categories of the device is greater than that of the object?
Here's the pseudocode for you:
FROM devices_categories
LEFT JOIN object_categories on ...
GROUP BY devices_categories... HAVING count(object_categories...) = 0
You can do this with arrays:
SELECT
"deviceId"
FROM
devices_categories
GROUP BY
"deviceId"
HAVING
array_agg("catId") @> (
SELECT
array_agg("categoryId")
FROM
object_categories
WHERE "objectId" = $1);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question