@@ -101,33 +101,43 @@ module ColliderModule
101
101
Base. invokelatest (eventToCall,(collider= collider, direction= collision[1 ]))
102
102
end
103
103
# Begin to overlap, correct position
104
- this. parent. transform. position = Math. Vector2f (transform. position. x, transform. position. y + collision[2 ])
104
+ if ! collider. isTrigger
105
+ this. parent. transform. position = Math. Vector2f (transform. position. x, transform. position. y + collision[2 ])
106
+ end
105
107
end
106
108
if collision[1 ] == Left:: CollisionDirection
107
109
push! (this. currentCollisions, collider)
108
110
for eventToCall in this. collisionEvents
109
111
Base. invokelatest (eventToCall,(collider= collider, direction= collision[1 ]))
110
112
end
111
- # Begin to overlap, correct position
112
- this. parent. transform. position = Math. Vector2f (transform. position. x + collision[2 ], transform. position. y)
113
+
114
+ if ! collider. isTrigger
115
+ # Begin to overlap, correct position
116
+ this. parent. transform. position = Math. Vector2f (transform. position. x + collision[2 ], transform. position. y)
117
+ end
113
118
end
114
119
if collision[1 ] == Right:: CollisionDirection
115
120
push! (this. currentCollisions, collider)
116
121
for eventToCall in this. collisionEvents
117
122
Base. invokelatest (eventToCall,(collider= collider, direction= collision[1 ]))
118
123
end
119
124
# Begin to overlap, correct position
120
- this. parent. transform. position = Math. Vector2f (transform. position. x - collision[2 ], transform. position. y)
125
+ if ! collider. isTrigger
126
+ this. parent. transform. position = Math. Vector2f (transform. position. x - collision[2 ], transform. position. y)
127
+ end
121
128
end
122
129
if collision[1 ] == Bottom:: CollisionDirection
123
130
push! (this. currentCollisions, collider)
124
131
for eventToCall in this. collisionEvents
125
132
Base. invokelatest (eventToCall,(collider= collider, direction= collision[1 ]))
126
133
end
127
134
# Begin to overlap, correct position
128
- this. parent. transform. position = Math. Vector2f (transform. position. x, transform. position. y - collision[2 ])
129
- if this. parent. rigidbody. velocity. y >= 0
130
- this. parent. rigidbody. grounded = true
135
+
136
+ if ! collider. isTrigger
137
+ this. parent. transform. position = Math. Vector2f (transform. position. x, transform. position. y - collision[2 ])
138
+ if this. parent. rigidbody. velocity. y >= 0
139
+ this. parent. rigidbody. grounded = true
140
+ end
131
141
end
132
142
end
133
143
if collision[1 ] == Below:: ColliderLocation
0 commit comments