#Water Interacting with the player

31 messages · Page 1 of 1 (latest)

white quartz
#

physics are pretty much defined as moving objects interacting wiht eachother. So what you are asking is pretty much what you already have, but not what you actually want.

#

if with animations you mean the animation player, those are inherently static, so not really suitable for dynamic interaction you would need here.

#

seeing how your current setup looks like would be necessary to decide how to achieve it best.

novel niche
#

(note: I am using a player script off a framework thats mimics 2D sonic movement)

#

should I?

#

?

novel niche
white quartz
white quartz
novel niche
#

for me to slow my player down it would be:

#

abs(motion.x) = 10

white quartz
#

giving your player some general way to let things affect its movement speed would probably make the most sense.

white quartz
novel niche
#

heres what I did

#

I cant figure this out:

#

func _on_body_entered(body: CharacterBody2D):
body.velocity = 1

#

i used 1 as a test, becuase the variables/constants in the player script cant be accessed

#

theres an error saying:

Error at (15, 21): Cannot assign a value of type "int" as "Vector2".

white quartz
novel niche
#

without using global scripts

#

maybe i can use methods

novel niche
#

yep I cant figure this out

white quartz
#

you are able to access self defined variables just like the ones built into the base classes you are using (like you did with body.velocity)