(FIXED) Expressions do not work

for some reason, expressions just do not want to work. they keep saying “EUnexpected” no matter what I put in. maybe its the symbol but then I’m not sure what it wants.

Can you send a screenshot of it or paste it here? Something to remember is you can’t do "10*-1* you need to do “10*(-1)”

You may also be using the “Math.[something]” incorrectly

1 Like


iunno why it says this

The expression only says “*”

What are you trying to do? Currently, you’re asking “Times” and that’s all.
An expression works like this,
*= Multiply
/ = Divide
+= Add
-= Minus

So if you wanted a negative value of what you input you can do
A*(-1)
If A = 10 the output would be -10


I’m assuming you have a set value for A and wanted to do something like “A*B”.

For more information here is the Behavior Handbook on expressions

2 Likes

When putting an expression into the expression behavior, you have to put the whole expression. In your case, that would look like: A+B
You should connect something to the ‘A’ node, or else you are not adding ‘B’ (object rotation) to anything.

3 Likes

I really suggest looking at the video when clicking the question mark icon in the behavior. Or look at other games on how it works, possibly from the help page.

There is a lot you can do with expressions, but it has to be able the read the equation you put into it.

What @CodeAlpaca and @DarkStar_Studios is both true, and we can help more if you explain what you want that expression block to do.

3 Likes

current progress. “invalid expression found”, guess im still missing something
im attempting to move a raycast on an object while still having it be 90 degrees (or to the right of the object)

So what you want to do is put A+90 inside the expression block. And the input for A to be the extractor number.

1 Like

You need to type the variables you want in the equation. You cant type “+” to add both variables, you’d need to type A+B, instead.

2 Likes

it fixed it! thank you so much lmao
i thought expression meant symbol, now i know it wants the full equation.

2 Likes